racing game: AI Car not turning corners correctly
allc1865
Member, PRO Posts: 777
Hi everyone!
In my game, my AI Car is controlled by actors that I put in the scene to tell it when to turn and how much to turn.
The way my game works is this: I create a new actor that is, say, -20. I put that actor on the scene, then go into my AI car and say, when it overlaps or collides with actor -20, change self attribute: rationIncrease to self.rotaionIncrease-20.
Everything works; when my AI car collides with the -20 actor it turns as it should. It's just that when it gets to a certain point, the car will spin out and go the other direction. I'm not sure why it does this so I wondering if anyone knew why or had any suggestions...
Thanks guys
In my game, my AI Car is controlled by actors that I put in the scene to tell it when to turn and how much to turn.
The way my game works is this: I create a new actor that is, say, -20. I put that actor on the scene, then go into my AI car and say, when it overlaps or collides with actor -20, change self attribute: rationIncrease to self.rotaionIncrease-20.
Everything works; when my AI car collides with the -20 actor it turns as it should. It's just that when it gets to a certain point, the car will spin out and go the other direction. I'm not sure why it does this so I wondering if anyone knew why or had any suggestions...
Thanks guys
Best Answer
-
-Timo- Posts: 2,313here is a template I made some time ago.
it has own steering of car and car AI and movement slow down (when driving in sand)
download link: http://www.mediafire.com/download/g8993zhr0wqmm83/car_minigame_prototype.zip
soon also available on http://gsinvention.com for free
Answers
http://www.deepblueapps.com/gs-racerz-template/
Darren.
Any help is appreciated
Darren.
@timolapre1998, hi, why does the AI car in your template move to the checkpoint and then off the screen to get to the other checkpoint?
I turned the wrap X and wrap Y off and that seemed to work, thanks