Actor trailing other actor
Atlanten
Member, PRO Posts: 56
Hello
I want to make an actor copy the position of another actor, but time delay it so that it trails after rather than sit on top. So if I had several actors doing that, with increasing time delay, I'd get a caterpillar-like motion.
I can't find a way to delay the actor's timing.
Do you know how to achieve that?
Any help would be much appreciated. Thanks!
I want to make an actor copy the position of another actor, but time delay it so that it trails after rather than sit on top. So if I had several actors doing that, with increasing time delay, I'd get a caterpillar-like motion.
I can't find a way to delay the actor's timing.
Do you know how to achieve that?
Any help would be much appreciated. Thanks!
Comments
You'll need to create two real attributes to track the location of the actor you're following.
Every second, constrain the location of the main actor to the two attributes made earlier.
Have the following actor move/accelerate towards those coordinates.
I tried it out, it kind of works, but it's not looking very smooth.
I'm trying now to constrain the positions, but subtracting the lead object's velocity from the follow object's position.. Looks like I'll be able to get a spring-y lag.
I was hoping for something like a time controlling function? So you could just set the object's relative time to -1 second. Would be awesome
http://www.gamesalad.com/game/play/17011
If anyone is interested please give me your email and i will you send you the scene-file...
cheers
SDMG
That is smooth... nice! I would love to see the code.
I will need something like this for a health bar for one of my BOSSes.
Would be a great one for the WIKI, BTW.
Xacto
--------------------------------
FireStar
http://gamesalad.com/game/play/8901
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Please send, I'd love to see how this is done.
manschat8537 [a] gmail.com
Thanks!
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
And SDMG, can you send me your file? It'd be very useful for some of my games! I think you already have my email!
Oh, and you get a mention in the credits of every game of course
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
For anybody looking for a solution to this, example 2 in this article got it working like a charm:
http://gamesalad.com/wiki/doku.php?id=how_to_gsc_follow_another_actor