Page 1 of 1
Following question
Posted:
Sun Feb 12, 2006 1:00 pm
by Troodon
Does anybody know how can I make an actor to follow another actor using the same route than the main actor.
better explainer wrote:Actor B follows actor A by the same route than actor A has just use.
Posted:
Sun Feb 12, 2006 9:39 pm
by duracel92
you could use paths? couldn't you? i think...
Posted:
Sun Feb 12, 2006 10:17 pm
by Game A Gogo
i dont tink its posiple unless you use some sort of ultra complicated script, lol.
Posted:
Sun Feb 12, 2006 10:45 pm
by Novice
You can do this by making the main actor create point actors on a timer, and then use a move to funct. to the last point actor and when it reaches that positions it destroys that point and so on.Also you could make it create another point actor each time a significant change in angle is made so actor B wouldnt cut across corners. Does this make any sense?
B-> P1..........P2...........P3.......P4........A->
Posted:
Mon Feb 13, 2006 12:45 am
by Fuzzy
what I would do is every draw, the actor in the lead emits his X and Y locations to a global array. Then each draw, the following actor looks that location up, and heads to it.
Thats assuming that every actor might be followed.
In the case of one actor always leading and one always following, just have the lead actor send his X and Y direct to the follower.
Put something like this in the leaders script.
FollowerXdest = x;
FollowerYdest = y;
then inside the followers script, you get follower to moveto(FollowerXdest,FollowerYdest)
Posted:
Mon Feb 13, 2006 6:58 pm
by Troodon
novice wrote:You can do this by making the main actor create point actors on a timer, and then use a move to funct. to the last point actor and when it reaches that positions it destroys that point and so on.Also you could make it create another point actor each time a significant change in angle is made so actor B wouldnt cut across corners. Does this make any sense?
B-> P1..........P2...........P3.......P4........A->
three finger pete wrote:what I would do is every draw, the actor in the lead emits his X and Y locations to a global array. Then each draw, the following actor looks that location up, and heads to it.
Thats assuming that every actor might be followed.
In the case of one actor always leading and one always following, just have the lead actor send his X and Y direct to the follower.
Put something like this in the leaders script.
FollowerXdest = x;
FollowerYdest = y;
then inside the followers script, you get follower to moveto(FollowerXdest,FollowerYdest)
THANK YOU VERY MUCH!!!