Actor problems please help

AppTapLLCAppTapLLC Member Posts: 10
edited November -1 in Working with GS (Mac)
I have an actor that moves forward at a constant speed when an attribute equals 1.
I also have an enemy actor that moves towards the actor in the sentence above, I want the actor in the top sentence to stop moving when he is (for example 150 pixels away) from the enemy actor

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256


    this video shows u how to use magnitude (which is the best way) to determine distant between actors. So set that up and whenever your magnitude attribute is < whatevever you want, change self motion linear x and motion linear y to 0

    there ya go :)
  • FloridaGamesFloridaGames Member Posts: 328
    Create an these attributes:
    actor 1 x
    actor 1 y
    actor 2 x
    actor 2 y
    constrain all these attributes to their certian positions. Ex: Constrain attribute: game.actor 1 x to self.position x.
    create these rule for actor :
    when any:
    (actor 1 x - actor 2 x) < or = 150
    (actor 1 y - actor 2 y) < or = 150
    then: change velocity to 0.
Sign In or Register to comment.