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
57
S
15
G
11
Posts: 912
Reputation: 12,581

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
378
S
219
G
84
Posts: 23,854
Reputation: 187,841

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: KittenKatja, MAVERICK, QuantumMMX, Zion and 13 guests