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
10
Posts: 912
Reputation: 12,011

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
362
S
216
G
75
Posts: 23,071
Reputation: 180,339

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: ChesVCF, Romalex360 and 27 guests