How would you design a track for motor bike type of game, in a way that it can be curved nicely?
Also how would you detect if the wheels touch the ground?
How would you design a track for motor bike type of game, in a way that it can be curved nicely?
Also how would you detect if the wheels touch the ground?
You could use an asset like TrackBuildR to design your tracks. I think you could make some nice curved tracks with it.
Cast a downward ray from your wheel and check if it hits something. If it does, then it’s grounded. If it doesn’t, then it’s airborne.
I should have mentioned that this will be 2D.
Yes you should.
Well, you can still cast a downward ray using Physics2D.Raycast to check whether your wheels are grounded.
I eventually decided to use Bezier collider from this stackoverflow post, which exploits Unity’s Edge collider.
It uses 4 Vector2 dots as input. I’d like to, instead of editing those vectors it in the inspector, have the dots in the scene view, so I could just drag them.
Now, making 4 child objects and using their position is something that I can easily do, but I’d prefer if I didn’t need those objects and I’m not that familiar with editor scripts.
Can someone tell me how to make a draggable point in scene view and what editor function should I override to get when it is overridden?