How can I make one actor following the other actor?

appsdesignappsdesign Member Posts: 2
edited February 2013 in Working with GS (Mac)
This can be a simple question,

but 'How can I make one actor following the other actor?'

Please help me~

Comments

  • WingmanappsWingmanapps Member Posts: 458
    Contrain actor 1 self.position.x,y to actor 2 self.position.x,y

    But be more specific in your description of your issue. Gives us a better chance of helping you instead us having to guess!
  • appsdesignappsdesign Member Posts: 2
    Thank you for your comment.
    Here's what I am going to do;
    'spawn enemies and make them follow the main character.'

    Thank you~
  • appsdesignappsdesign Member Posts: 2
    Contrain actor 1 self.position.x,y to actor 2 self.position.x,y

    But be more specific in your description of your issue. Gives us a better chance of helping you instead us having to guess!
    Thank you for your comment.
    Here's what I am going to do;
    'spawn enemies and make them follow the main character.'

    Thank you~

  • SocksSocks London, UK.Member Posts: 12,822
    Thank you for your comment.
    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
  • WingmanappsWingmanapps Member Posts: 458
    You can use the move to command but you will need to constrain the main character X & Y position to a real attribute so the enemy knows where to go.

    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.


Sign In or Register to comment.