How can you detect which way an actor is moving?

Sheldon392Sheldon392 Member Posts: 43
edited November -1 in Working with GS (Mac)
I have an actor that has a scarf behind him and I need it to flow accordingly to the way he is moving.

Comments

  • GamersRejoiceGamersRejoice Member Posts: 817
    what kind of directions can your actor move? Is it just left and right? or all directions?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    if self motion linear x is greater then 0 your moving right, if its less then zero your moving left.

    if self motion linear y is greater then 0 your moving up and if its less then zero your moving down.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can Easily tell the general Direction an Actor is moving by checking linearvelocity.x and linearvelocty.y

    Positive value for x is moving on the x axis to the right. A negative value means moving to the left

    Positive value for y is moving on the y axis up and a negative value is moving down.

    By knowing that you can tell if an actor is moving in general direction For example If the actor has a positive x and a negative y then you know it is moving at an angle down and to the right.

    Good Luck Hope that helps.
Sign In or Register to comment.