My character follows the mouse, but keeps turning upside down

3

My character moves ('flies') following the mouse, but he is always turning sideways or upside down. Does anybody know how to solve this? (for him to remain standing, as is the sprite)?

When I change the Set angle toward Set position, the Player stops spinning upside down, but then he moves very fast (following the mouse), ignoring the Behavior of bullet 40).

The Behaviors that the Player has are: BoundToLayout + Bullet + Solid.

For two days I've tried to solve this, so thank you very much if anyone can help me.

    
asked by anonymous 21.02.2016 / 02:34

1 answer

4

As the character has behavior Bullet enabled, I believe a possible workaround is to use the Set angle of motion rather than the character%% of the character.

The parameter entered in the method call is the angle between the object and the mouse cursor:

Set angle toward

  • In the character's action, it looks like this:


  • Sothatthereisnorotationoftheobjectduringthemovement,the%propertyofthebehaviorBulletshouldhavethevalueangle(Self.X,Self.Y,Mouse.X,Mouse.Y):

  • Withthesechanges,theresultlookslikethis:

    
21.02.2016 / 06:08