How can I make a control oscillation?

Get help using Construct 2

Post » Thu Mar 20, 2014 9:27 pm

I tried this:
Image

But something is wrong. If I change the angle increment, the control (joystick/sidestick) turn 360 degree (cw or ccw).

I wish the joystick oscillate continuously, as if on autopilot.

Thanks
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Fri Mar 21, 2014 4:59 am

Do you have a CAPX that we can play with, as I can't figure out what exactly you're trying to do
Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Fri Mar 21, 2014 10:07 am

@emoaden: This animation is just a detail of the whole game and not have a direct relation with the rest of the script. I want the image turning from one side to the other, just to put it in motion, like a oscillation movement. I just do not understand why, when I try to change the values ​​(angle or speed), the image starts to rotate 360 ​​degrees instead of being restricted to the angle that I specified (345 ~ 25)
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Fri Mar 21, 2014 10:18 am

Maybe try the sine behavior instead.
B
48
S
16
G
9
Posts: 1,097
Reputation: 11,195

Post » Fri Mar 21, 2014 11:26 am

Using R243 for all examples
B
69
S
20
G
6
Posts: 379
Reputation: 9,699

Post » Fri Mar 21, 2014 11:57 am

@emoaeden: Exactly. Thanks.

I changed the speed and limits values in your example and everything worked perfectly.

I wonder why my script does not work properly.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041

Post » Fri Mar 21, 2014 12:13 pm

@RenatoB - in your script I cannot see where you are changing control.angle ? It might also be a good idea to not use "is angle=amount..." but but to use "is angle<= amount..." - probably ok here but sometimes they two side are slightly out (ie not equal)

Personally I would go with spongehammer and use sine behaviour as it is ideal for this type of movement.
You do not have the required permissions to view the files attached to this post.
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,832

Post » Fri Mar 21, 2014 12:56 pm

@RamPackWobble: You're right. Actually the result is very good. The movement is much smoother. Thank you very much for the example.

@spongehammer: Thanks for the suggestion.
B
74
S
13
G
4
Posts: 1,000
Reputation: 8,041


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], tarek2 and 13 guests