HI all,
I'm new here and new in game development. I'm looking for a way to make shapes (objects) follow a curved path and turn at the same time.
To make it more simple, I have a square grid with defined nodes. I already implemented the code that makes the object follow waypoints but they cannot turn while moving - the object reaches the node, stops, turns on the spot to to the next waypoint and starts moving again.
I tried to change the offset of the ocject and play with the coordinates to make a fake pivot for the turn and it works. The main problem is that it seems to be dependent on the initial conditions.
Example: the object is facing north and then all the right turns work, but when I start the scenario with the object facing say east then the turns are all messed up (it will still turn right but during the turn it will be "teleported" to another position)
Any advice or any alternative method/solution to make an object turn "like on rails"
Thanks!
Path following - like on rails
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Path following - like on rails
Maybe something like this.
Left click and drag to change path.
Left click and drag to change path.
- Attachments
-
- fly.love
- spline path
- (172.51 KiB) Downloaded 197 times
Re: Path following - like on rails
I solved my problem... there were some rounding errors but yes thank you for the small program it is exactly what I was looking for
Thanks again!
Thanks again!
Who is online
Users browsing this forum: No registered users and 4 guests