Smooth Rotation(Set Angle)

Get help using Construct 2

Post » Thu Apr 04, 2013 9:53 pm

I have an enemy that chases my Player by setting it's angle towards the player, as in the Ghost Shooter game. It's a top-down view, so when the enemy turns it looks very...... "clunky". Is there a way to "smooth" the rotation of the enemy sprite? I'm using "Set angle towards" (Player.X, Player.Y)

Thanks in advance.
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Thu Apr 04, 2013 10:00 pm

Use "Rotate towards position" instead. Use a low value for the degrees, like 1 or 2, and it'll be buttery smooth.
B
56
S
15
G
10
Posts: 910
Reputation: 11,972

Post » Thu Apr 04, 2013 10:21 pm

@GeometriX is right, but it's best practice to use delta-time. So you should rotate it something like 90 * dt degrees towards a position, then it will rotate at 90 degrees per second.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Thu Apr 04, 2013 10:38 pm

Awesome! Thanks a ton you guys, that really helped with the movement.
B
12
S
2
Posts: 75
Reputation: 2,126


Return to How do I....?

Who is online

Users browsing this forum: Vallar and 18 guests