Move to a position and do not change direction

cibramcibram Member Posts: 7
edited June 2012 in Working with GS (Mac)
Hey guys, i am NEW here, so please welcome me and help with this question :)

- 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

  • tenrdrmertenrdrmer Posts: 9,934
    Accepted Answer
    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

  • IsabelleKIsabelleK Member, Sous Chef Posts: 2,807
    edited June 2012
    Make two real attributes:
    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.
  • cibramcibram Member Posts: 7
    Unfortunately No, because i want that spawned actor move to Hero's exact position at the time it spawned, for example;

    - 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.





Sign In or Register to comment.