How do I switch the switch

Just started using Construct 2? Post your questions here

Post » Thu Oct 16, 2014 11:44 am

Dear Friends,

Sometimes it looks if I am blind for some problems,
I can't see what I am doing wrong.
Could anybody please explain why this does not work?
And please tell me how to solve this?

I made a switch that one can turn in 3 positions
Position 0 = 0 degrees
Position 1 = -60 degrees
Position 2 = +60 degrees

I tried two methods, but neither of them will function.
I guess this is a simple mistake I made, but I can't find the proper way to turn the switch.
Frustrating...
Thanks in advance for your help.

Method2.PNG


Method1.PNG
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 14
Reputation: 260

Post » Thu Oct 16, 2014 12:03 pm

Don't stack the logic like that. Your first test should be: Left-clicked. From there use sub-events to break down the next steps for 0 Else -60 Else 60.
If you step through what it's doing you see what is wrong. (Method2.PNG won't work as you are changing frames but testing angles - you didn't change the angle). Method1.PNG: When the events run, "Left-clicked is True *for all cases*. So, event 4 checks the angle is 0, then sets it to -60. Then event 5 runs and the angle is -60, so it sets it to 60, then event 6 runs and sets it to 0!
You do not have the required permissions to view the files attached to this post.
ImageImageImage
B
71
S
22
G
249
Posts: 3,764
Reputation: 138,579

Post » Thu Oct 16, 2014 2:48 pm

Thanks a lot blackhornet.
That's completely different from what I did!
Now I understand what I did wrong.
The capx file was very helpfull, without I could'nt understand.

I hope once I have your level and will be able to help beginners like me.

Great, Thanks again, also for the quick reply!
B
5
Posts: 14
Reputation: 260


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests