How can I make one actor following the other actor?
appsdesign
Member Posts: 2
This can be a simple question,
but 'How can I make one actor following the other actor?'
Please help me~
but 'How can I make one actor following the other actor?'
Please help me~
Comments
But be more specific in your description of your issue. Gives us a better chance of helping you instead us having to guess!
Here's what I am going to do;
'spawn enemies and make them follow the main character.'
Thank you~
Here's what I am going to do;
'spawn enemies and make them follow the main character.'
Thank you~
You need first to make two 'real' Game attributes . .
Let's call them MainCharacterX and MainCharacterY
Then get the main character to pass it's coordinates to these two attributes.
In the main character place two constrains:
Constrain MainCharacterX to self position X
Constrain MainCharacterY to self position Y
Then get the spawned actor to follow these coordinates
In the spawned actor place two constrains:
Constrain self position X to MainCharacterX
Constrain self position Y to MainCharacterY
http://www.youtube.com/watch?feature=player_embedded&v=YzPoLD4ZQM0
You can also use magnitude to determine the distance between the hero and enemy and a self start X & Y on the enemy so if the hero is so far in front the enemy will go back to its starting position.