I've made a very simple game in which you navigate a ball around (like the template). I have now constructed some roads through my level. To further experiment, I know want to reduce the velocity of my player, if it is rolling offroad.
I first thought, I'd use a Raycast via Physics.Raycast(), but there are no EntityRaycastFlags for "Road". And when I use EntityRaycastFlags.All it hits the terrain under the road instead (at least I think that's what happens, I can't get information about the hit in the out RaycastHit because it's not an entity that's being hit). Since my Road is using a unique material, is it possible to get the currently colliding material?
Does anyone has some ideas for this? Surely, there must be a way, it seems like a really simple functionality of a road to know if the character is walking on it.
C++ function names are also welcome, I can often find a wrapper around them in C#

kind regards,
Brotato