Game Development Community

Keeping track of vehicles on a track

by BigPapa · in Torque Game Engine · 07/08/2005 (10:26 pm) · 2 replies

If you have played with the starter.racing kit, you know that if you flip your car and reset it, you end up back in the starting line. I'm trying to reset the car in the last place on the track where it was before it flips or bounces out of the track.

I figured the easiest way would be by using triggers along the path of the track. Every time a trigger is tripped, the transform of the trigger is saved on a variable in the Vehicle Datablock.

I already accomplished this. Now I need to come up with a way to extract that variable from the vehicle datablock and pass it to the reset function so that the car is placed in the center of the last trigger that it entered.

Has anybody done anything like this or has a better idea of how to accomplish this?

Thx!

#1
07/31/2005 (8:54 am)
So i came up with the idea of filling the track with triggers. As the vehicle drives around the track, every time a trigger is triggered, the trigger then saves it's world coordinates to a variable in the vehicle's datablock. When the player resets the car because the vehicle flipped or ran off the track, the respawn function gets the value of the last trigger entered as the respawn value.

I just have to work out some bugs but it works pretty well for the most part.
#2
10/18/2005 (5:32 am)
Post it when you geta working versin plz thanks.