Rotate to face direction moving
Hi, Having a bit of a problem in 0.9.80.
I want my actor to face the direction its moving. I have used the following similar equation in the past to get this to work
Constrain Attribute Self.Rotation -> VectorToAngle(Self.Motion.Linear.Velocity.X, Self.Motion.LinearVelocity.Y)
Now this works fine on Creator, when I move left or right the player faces the way its moving but on my device it doesn't work.
I set up a rule so i can see the Linear Velocity X as the player moves and its displaying a weird number the last few digits are e-06 which I think is some kind of error message.
Again, on the creator this works fine and the linear velocity x number goes up and down from negatives hundreds to hundreds so the rule works well.
Anyone else got any ideas on why this might be happening?
Some more bits of information
It works when using keyboard controls in creator, on the device I'm using accelerometer controls to move left and right.
I want my actor to face the direction its moving. I have used the following similar equation in the past to get this to work
Constrain Attribute Self.Rotation -> VectorToAngle(Self.Motion.Linear.Velocity.X, Self.Motion.LinearVelocity.Y)
Now this works fine on Creator, when I move left or right the player faces the way its moving but on my device it doesn't work.
I set up a rule so i can see the Linear Velocity X as the player moves and its displaying a weird number the last few digits are e-06 which I think is some kind of error message.
Again, on the creator this works fine and the linear velocity x number goes up and down from negatives hundreds to hundreds so the rule works well.
Anyone else got any ideas on why this might be happening?
Some more bits of information
It works when using keyboard controls in creator, on the device I'm using accelerometer controls to move left and right.
Comments
It seems constrained or interpolated self.positions don't register as a velocity value, so the VectorToAngle function is having no effect. I guess this is sort of a bug but it depends how you look at it ?