How do I make my enemies move towards my Hero's position?
williamtyleradair
Member Posts: 12
Hello everyone, I'm hoping that somebody out there can assist me with a problem I am having in my game. I am designing an "enemy wave" style game, and I want my enemies to spawn in specific locations and then accelerate towards my Hero when the round starts. I am new to GameSalad, but have a pretty okay understanding of how things work from prior UDK use, so I shouldn't be to lost if somebody could please assist me. I have tried to set attributes for the Hero's X and Y positions, followed by a Move To "player X" and "player Y" behavior on the enemy actor, but that didn't do the trick. If anyone can help me solve my problem I'd greatly appreciate it!
Comments
on your hero,
constrain "hero-x" to self.position-x
constrain "hero-y" to self.position-y
on your enemies after they spawn add
move to x="hero-x"
move to y="hero-y"
this should work.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User