- Home /
How I make a road collider?
Hello everyone!
I'm making a game in unity and I do not want my car goes off the road, in the unity car tutorial the track have a road collider, I want to make a collider like that, someone could help me? someone has a tutorial that explain that? I await response Thanks!
Answer by LightSource · Mar 18, 2013 at 03:17 PM
Just make two cubes, size and position them, and turn off the mesh renderer. You dont need any special "road collider".
can you explain it, where i put this cubes, if i don't put any collider on road then our vehicle falls down. please explian
Put the cube with the mesh render disabled, under the road so that the vehicle rests on top of it.
(Turning off mesh render makes it invisible so it might be easier to turn it back on and position it, then turn it back off).
OH YOU $$anonymous$$EANT A COLLIDER ON THE ROAD! All you do is select your road object or mesh, then go to Components > Physics > Box Collider