Rotate to face direction moving

micksolomicksolo Member Posts: 264
edited November -1 in Working with GS (Mac)
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.

Comments

  • Rob2Rob2 Member Posts: 2,402
    The e-06 is part of a number expressed using scientific notation http://en.wikipedia.org/wiki/Scientific_notation

    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 ?
  • capitalcarnagecapitalcarnage Member Posts: 371
    Hmmm.... I also am suffering from a very similar issue... any way round - constrained or interpolated self.positions don't register as a velocity value?
Sign In or Register to comment.