Rotate towards with TurnRate

Get help using Construct 2

Post » Sun Aug 03, 2014 8:26 pm

I made custom turret mechanics and currently im using "set angle" to targets for my sprite - ofcourse this works instantly. Any ideas how made a smooth rotation with specified speed?
Sorry for my sucky english :P
B
9
S
2
G
2
Posts: 10
Reputation: 1,035

Post » Sun Aug 03, 2014 9:13 pm

try using one of the rotate actions instead. (rotate clockwise, rotate towards position, etc..).
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Sun Aug 03, 2014 9:32 pm

Nope
Rotate actions requires to specify "degrees" and also works instantly.
B
9
S
2
G
2
Posts: 10
Reputation: 1,035

Post » Sun Aug 03, 2014 10:32 pm

the degrees parameter, in this case, refers to how many degrees to rotate, not an actual position. try a small number here.

like:

if turret has line of sight to target,
rotate towards position (target.x, target.y) 0.5 degrees.
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Mon Aug 04, 2014 1:16 am

You almost certainly need this Rotate To Plugin by Rex Rainbow. It's awesome and should meet your every need when rotating objects - you can set angular acceleration, deceleration and angle to rotate to (shortest / clockwise / anti-clockwise). Enjoy...
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Mon Aug 04, 2014 8:02 am

Plugin did the trick
Thx
B
9
S
2
G
2
Posts: 10
Reputation: 1,035


Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 19 guests