How can i make one saw trap move downwards when another one is moving upwards

I have 2 saw traps and they both move vertically at the same time. but I need when one is going upwards the other one is going down, I tried to use the toggle direction event but it just froze. any ideas?

(The code I was trying to use with the toggle direction event)

If you have only 2
You can try check if saw.X < saw,X
And so this will tell you which saw is on the left
If it works then you can in action apply something for that saw
And then do saw.X > saw.X and apply opposite thing in action for right saw

If that does not work i still have few ideas

1 Like

I tried to do that; I think. I’m not sure if this is what u meant exactly but it just made it move the same exact time right next each other unfortunately.

Is this what u meant?

No you cannot. Which saw is the one above, and which is below if you refer to them in the actions?


@HoepherGames, here’s a way of doing this:

  1. Create a new object (I’ve called it Top_of_up_down), and place it at the top of where you want the up/down saws to go.
  2. Add a boolean variable named is_going_up to the Saw_up_down object.
  3. In the editor, click on each saw object in the scene in turn. Set the variable is_going_up to true or false depending on whether it’s going up or not.
  4. Use an event similar to this to make it work:


This will toggle the value every single frame that SAW_UP_DOWN is moving up, making SAW_UP_DOWN_2 appear as if it’s frozen or jiggling in place.

1 Like

Option B

Halfway he starts to talk about boolean variables
What you are interested in is instance ID when he make 1 enemy go right and other left

1 Like