How to make an actor follow another actor to only one direction?
LordTarantor
Member, PRO Posts: 890
Let say I trow an actor#1 up and I want a couple of actors to follow it while it is going up but to stop following it and stay in place as soon as actor#1 will start to go down. Also taking in consideration that actor#1 can go up at different speeds.
Comments
When [actor is already moving up... maybe you have a Touch is Pressed or a time delay or some other condition for when this happens]
When self.motion.linear velocity.Y ≤ 0
Change attribute game.MovingDown [boolean] to true
Following actors
When attribute game.MovingDown is false
[follow actor #1]
Otherwise
Change Velocity to 0 [or spawn a copy that doesn't move and then destroy the actor]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I'll get right to it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User