Hello community, I hope you are having a nice weekend
I have one question which I can’t wrap my head around. In my scene, I have a car, which has speed and rim size controls, all those things work nicely.
But as you can imagine, I want my car to drive only in specific area, so it doesn’t go out of the scene.
The issue is, I don’t know how to do it properly. I have tried it with “if” statements, checking if car has reached a certain position and then animating it again, but that logic doesn’t seem to work well, I wonder maybe it is possible to somehow set boundaries or something?
My ultimate goal would be to see car going:
- Straight until water
- Then it turns 180 degrees (I will just rotate all wheels and car frame itself)
- And then again straight to end of plane
- Turn around and then again go till the water… etc
And this cycle should repeat infinitely (I suppose you get this idea).
If you have any thoughts or ideas, they are all welcome. And here is my JS part of the code so you can take a look at it: https://pastebin.com/TGegwgJw