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
92
S
32
G
106
Posts: 5,272
Reputation: 69,455


Return to How do I....?

Who is online

Users browsing this forum: jatin1726, nahima and 5 guests