[SOLVED]Can I rotate an object towrads a position slowly

Get help using Construct 2

Post » Tue Mar 11, 2014 11:36 am

Hello,

i have an object constantly moves forward during game. Player decides where it will go by clikcing/tabbing screen.
each time player tabs a position i use:

object - rotate 30 degrees towards (Mouse.X, Mouse.Y)

but this rotation is instant. i want a smooth movement like rotating the object within a time, instead of rotating instandly.
How can i make this?
Last edited by Aleq on Fri Apr 11, 2014 9:17 pm, edited 2 times in total.
Truth shall be your freedom...
B
14
S
2
G
1
Posts: 45
Reputation: 930

Post » Tue Mar 11, 2014 11:57 am

Try with the rotate behavior :)
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 12:10 pm

Rotate behavior makes an object cosntandly rotate around itself. if u set its speed to 0 it stops turning around.

Even onbject has a rotate speed you cannot rotate it towards a position within a time. action makes it instandly rotate towards position. and it continues spinning around itself
Truth shall be your freedom...
B
14
S
2
G
1
Posts: 45
Reputation: 930

Post » Tue Mar 11, 2014 1:05 pm

A simple way is to use the LiteTween behavior : behavior-litetween_t70700

Try a configuration like this for your sprite :
You do not have the required permissions to view the files attached to this post.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 2:01 pm

i cannot find an action which will replace the one below according to your attached behavior:
"object - rotate 30 degrees towards (Mouse.X, Mouse.Y)"

edit: im not permitted to post links yet sample is attached
You do not have the required permissions to view the files attached to this post.
Truth shall be your freedom...
B
14
S
2
G
1
Posts: 45
Reputation: 930

Post » Tue Mar 11, 2014 3:12 pm

Sorry if I don't get what you are asking for ...
Is it this ? :D
You do not have the required permissions to view the files attached to this post.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 3:56 pm

Yes something like that.

However as i can see from your expression, that tween behavior will not help me. Couse it is always turns the objects in same rotation. and exactly to the mouse click position. So when i click to a place that will force it to turn to opposite direction, object spins around.

- What i am trying to do is moving the object towards its forward angle.
- this angle will be determined by player with mouse clikcs.
- object will turn towards to the mouse click location like 30 degrees. or lesser if its less then 30 degrees.

why 30 degrees? couse i want the controls a bit harder.

my project works perfectly. however i need my object to turn slowly, not instant

Thank you for your help.
Truth shall be your freedom...
B
14
S
2
G
1
Posts: 45
Reputation: 930

Post » Fri Apr 11, 2014 5:59 pm

any ideas about this?
Truth shall be your freedom...
B
14
S
2
G
1
Posts: 45
Reputation: 930

Post » Fri Apr 11, 2014 7:32 pm

There is a "rotate-to" plugin that should do exactly what you're asking. Can't find it for the life of me, however...
B
43
S
7
G
6
Posts: 45
Reputation: 4,752

Post » Fri Apr 11, 2014 8:23 pm

Would it work to use the action in your first post under a every tick event, only change 30 to 30*dt?
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 9 guests