Change Path/Waypoint
Hi!
I'm working on a game where incoming AI cars need to change direction at an intersection. I saw a Tower Defense video on youtube where the actors changed direction when they overlapped/collided with an invisible waypoint. Anyone know how to do this?
-Erik
I'm working on a game where incoming AI cars need to change direction at an intersection. I saw a Tower Defense video on youtube where the actors changed direction when they overlapped/collided with an invisible waypoint. Anyone know how to do this?
-Erik
Comments
place it in the middle of the intersection point on your image
and in your prototype for the cars:
Rule: when
Event: overlaps or collides with actor dirChange
--do changes for car's direction that you want.
when it works well … dirChanger Attributes > Graphics > uncheck the Visible boolean
@};- MH
Now, after adding the rule you suggested, it only bumps into the dirChange actor, slides on its edge towards the new direction i've set, then continues in the original direction. Obviously, it understands it as "Change direction only while colliding with dirChange, but not permanently."
Any suggestions?
Thank you MH for your fast reply.
For the car:
(when born/spawned) Change attribute: self.motion.linear.y to 100
Rule: when overlaps or collides with waypoint actor
Change attribute: self.motion.lenar.x to 100
and Change attribute: self.motion.lineary to 0
-Erik
often good to:
Save As… your game to a new sandBox project and play around there until you find what works best, for you.
then add those behaviors to your original game.
@};- MH