How do I get the X velocity of my player that is being moved by touch?

I’m updating my player position every frame to match my finger position X but can’t figure out how to flip the image to correspond to going left poor right… any help is appreciated! :slight_smile: thanx :D  :D 

Hi @austin.rau18,

If you’re using a simple X-position update, then you should just compare the previous X position to the current X position, and if it’s less than the previous, you know your object is going left. Otherwise, it’s going right. Based on this, you can set a flag variable to flip the object (scale its X value by -1).

Hope this helps,

Brent

Hi @austin.rau18,

If you’re using a simple X-position update, then you should just compare the previous X position to the current X position, and if it’s less than the previous, you know your object is going left. Otherwise, it’s going right. Based on this, you can set a flag variable to flip the object (scale its X value by -1).

Hope this helps,

Brent