How do I make smooth rotation

Get help using Construct 2

Post » Thu May 28, 2015 6:29 pm

I want to rotate the object slowly towards the clicked enemy.
I try the following code:

Code: Select all
On right button clicked
Cursor is over the Enemy
                   Pick [b]player [/b]where player.selected=1
                   Every 0,1 seconds----->rotate 20*dt degrees towards (LastX,LastY)


But the player rotates only once, is this can be done withot plugins.
B
20
S
4
Posts: 51
Reputation: 1,104

Post » Thu May 28, 2015 6:38 pm

One way is to use a variable.

Code: Select all
global number target= -1

on right clicked on enemy
--- set target to enemy.uid

Player.selected = 1
pick enemy by uid target
every 0.1 seconds
--- rotate 20*dt derees towards (enemy.x, enemy.y)
B
94
S
33
G
114
Posts: 5,359
Reputation: 73,779


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests