Detecting actor movement direction without using player.linear velocity?

quinniiquinnii Member, BASIC Posts: 3

Morning (Depending on where you are!),

Im trying to detect which direction an actor is being interpolated in order to add an animation based on it's direction, obviously the "Interpolate" attribute overrides physics so i can't use the linear velocity to detect the direction.

Are there any other alternatives?

To clarify i need to detect three different movements; left, stationary and right.

This is my first post, long time user and long time lurker on the forum so hi to everyone!

Cheers,

Stu

Comments

  • IceboxIcebox Member Posts: 1,485

    Are you moving your actor with interpolate ?

  • quinniiquinnii Member, BASIC Posts: 3

    Yeah interpolating it to the right, then to the left repeatedly with the occasional pause in the movement (with random x coordinates each time)

  • IceboxIcebox Member Posts: 1,485
    edited July 2016

    in your pause rule put your stationary image or animation and put your movement animation in the otherwise section. So if its not paused it will always animate.
    Then in the rule where it interpolates repeatedly
    When it interpolates from right to left put a change attribute self.flip horizontally to false.
    when it interpolates from left to right put a change attribute self.flip horizontally to true.

    This will flip the image and animation right or left depending on the direction of your image instead of having 2 animations for going right and left

  • quinniiquinnii Member, BASIC Posts: 3

    Awesome idea, cheers for that.

    Im actually using an integer to control each frame of my animation sequences (long story) but i can work round that.

    The flip self.flip will be a problem though as the actor isn't symmetrical so il have to use the 2 animations.

    Cheers for your help.

Sign In or Register to comment.