Button and barrier

Can somebody if possible tell me how to make a button that when pressed activates 1 barrier and deactivates 2 other ones then once pressed again it does the same but activates a different one and deactivates two others (using 3 barriers fyi)

2 Likes

Make a button send on Channel A and then make 1 barrier activate on channel A and the two others deactivate on channel A

1 Like

but how do I make the button deactivate A and B while activating C and so on once pressed again?

1 Like

Do you want it to reactivate after a few seconds?

No, no timing involved

1 Like

Ohh so it activates the barriers after they are deactivated and so on when you press the button?

1 Like

Do you mean if I clicked the button, Barriers A and C would activate and B would stay deactivated and when I clicked it again, A and C deactivates while B activates or is it a different way?

no only 1 activates at a time and not randomly

So when you press the button
A activates
B and C deactivates?

1 Like

Yes that’s correct. Then once pressed again A and B deactivate and C activates

Would it randomize between the 2 deactivated barriers to choose which one activates next?

Then why even post :skull:

1 Like

Then why does C activate? If in this case A activated first then C, why not B?

the first time A is on while B and C are off then once pressed again A and B are off then C is on then A and C are off and B is once etc.

Ok, so the pattern is A on, then C on, then B on. With each button click deactivating the other two?

1 Like

So A first C next and B finally.

2 Likes

then it can repeat itself

2 Likes

Ah…ok.

So, here’s what you’ll want to do.

Have the button increment a counter that updates a property. Then add 3 different checkers to test the value. If it’s 1 broadcast on 1, if its 2 broadcast on 2, and the same for 3. Then for the barriers, have barrier A activate on 1. C activates on 2, and B activates for 3.

Now, there’s a trick how you can have multiple channels in a prop. For for A, B, and C, add their other numbers. For example, if A activates on 1, their deactivation channel would be 2,3 because those are the channels that the other barriers activate on.

For C, theirs would be 1,3 since they activate on 2. And hopefully you can figure out 3.

3 Likes

Uhh make this code on a trigger I think.
Make a variable called anything you want.
On button pressed send a channel to the trigger to run this code.

Change “Variable” by 1
If variable = 1 then 
Send channel A activates
If variable = 2 then 
Send channel C activates
If variable = 3 then 
Send channel B activates
Set variable to 0
3 Likes

I’m terrible with the blocks but this does seem easy however I do have a few questions like what about deactivating? Or is it when it changes the other two deactivate? And how do I send out the signal?

1 Like

I’m lookin at solutions u can do,

guu :wink:

2 Likes