Set angle toward smoothly by clicking

Get help using Construct 2

Post » Wed Jun 26, 2013 2:38 pm

Hello, I would like to know how is done so that an object rotates smoothly (on its axis without moving) at the point where you click or tap. They do it to make the object rotate but gently. I do so



How come to do just that yet smoothly by clicking?
I upload a sample: Capx
B
6
Posts: 24
Reputation: 774

Post » Wed Jun 26, 2013 2:51 pm

Use Rotate Towards Position instead. The Degree value is how fast it will rotate, the lower the value the slower it rotates.

B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Wed Jun 26, 2013 3:01 pm

I already did but it does not work. That alone makes a small turn without getting to where I clicked .. I want a click turn to where I clicked. Does anyone know how to do?
B
6
Posts: 24
Reputation: 774

Post » Wed Jun 26, 2013 3:03 pm

Edit: I want to make a turn to where I click click, without having to leave it pressed.
B
6
Posts: 24
Reputation: 774

Post » Wed Jun 26, 2013 3:04 pm

Edit2: I want to make a click turn to where I clicked. Without having to leave it pressed. help please.
B
6
Posts: 24
Reputation: 774

Post » Wed Jun 26, 2013 3:28 pm

you need another sprite to set position to touch and have the object rotate toward that sprite
B
40
S
11
G
7
Posts: 514
Reputation: 9,636

Post » Wed Jun 26, 2013 3:55 pm

Or 2 private variables. When you click, set them to touch.x and touch.y then rotate the object to them every tick. If you want it to be really smooth then use Lerp()!
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Wed Jun 26, 2013 3:59 pm

Edit:
Never mind. Pretty much what Tokinsom said :)

Static rotation on the left. AngleLerp used on the right.
Capxzatyka2013-06-26 16:10:19
B
62
S
19
G
8
Posts: 341
Reputation: 12,075

Post » Wed Jun 26, 2013 4:39 pm

Thank you very much guys, it's what I needed. Thanks @ zatyka by CapX, is perfect!
B
6
Posts: 24
Reputation: 774


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], MadSpy and 5 guests