Go Back On Pathfinding

Get help using Construct 2

Post » Wed Apr 22, 2015 11:46 pm

I have a problem with pathfinding. In my game, its situated on a train, and every 40 seconds, the train stops and the pedestrians find a path to the door and then set position to the door on the other side and go back to their seats, giving the effect that passengers are getting on and off. I'm wondering how to get them to go back to their specific seats. I have a object on each seat called SitAlert, but they all just go back to the original. Any help is appreciated, thanks
B
9
S
2
Posts: 9
Reputation: 545

Post » Thu Apr 23, 2015 12:28 am

You could make two variables X_Original, Y_Original in those you store the position of the seat they need. And when you need them to go back.

For each Passenger
Find Path (X_Original, Y_Original)

Otherwise you can store the Seat.UID in each passenger object and just use that.
For each Passenger
Pick Seat with UID = Passenger.Seat_UID
Find path (Seat.X, Seat.Y)
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Sat Apr 25, 2015 6:09 pm

An instance variable or a global one? Sorry, I'm new at this
B
9
S
2
Posts: 9
Reputation: 545

Post » Sun Apr 26, 2015 6:17 am

instance variable as you need to store a specific seat location with a specific passenger
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests