Expression help: Need comp to flip it's scale based on left/right movement
I've got a composition of an animated bug. I have a script that gives it random movement left and right with pauses (so it'll crawl randomly left or right, stop, then crawl again at random intervals).
I'm looking for a way to flip the composition to face the direction it is moving and STAY that way while paused.
I'm currently using this hackey way to flip the X scale depending on the direction it's moving, but it always goes back to facing one way when it stops, when it should be facing the way it was facing when it stopped.
var movement = transform.position.velocity;
if (movement[0] < 0) {
transform.scale
} else {
[transform.scale[0]*-1,transform.scale[1]]
}I hope that makes sense?
Any help would be awesome, thanks!
