Move to a position and do not change direction
![cibram](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey guys, i am NEW here, so please welcome me and help with this question ![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
- I have an actor which is Spawning every 1 second.
- I want this actor to move for where player standing at when it spawned and cant change that direction even if the player moves another place while that actor coming towards him.
if needed : the camera is top down
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
- I have an actor which is Spawning every 1 second.
- I want this actor to move for where player standing at when it spawned and cant change that direction even if the player moves another place while that actor coming towards him.
if needed : the camera is top down
Best Answer
-
tenrdrmer Posts: 9,934
Follow All those previous rule but add a 2 Real self attributes to your spawned actor.
Self.Target.x
Self.Target.y
Put at the top of your spawned actor
Change Att self.target.x to game.hero.x
Change Att self.target.y to game.hero.y
Then in your move to use your self attributes for the position
Answers
HeroX
HeroY
Constrain these attributes to Hero position (X to X, and Y to Y).
In your spawned actor put a Move To behavior, and move them to game.HeroX, and game.HeroY.
Turn off "Run to Completion".
Not sure if this will work, as you want thou.
- Whenever the Actor Spawned at X:5 , Y:5 position
- My Hero was at X:20 , Y:20 position - but my hero is moving to another position,
- So what i want is, Spawned Actor must go to X:20 , Y:20 - NOT FOLLOW the hero.