Moving an object up and down on a click

[CoSpaces Edu :: Moving an object up and down on click]

I am trying to move an object up and down on a click. The code I have works for the first two clicks. When I click on the object the first time, it goes up. When I click on the object a second time, it goes down. When I click on it a 3rd time it goes down again when I’d like it to go up.

P.S. I would eventually like to have duplicate objects do the same thing so if you have code that would accomplish that, I would appreciate it.

1 Like

Hi @TechWarriors,

Two things here:

  1. You need to change your variable back to false once it’s true, and vice versa.
  2. Instead of nested events, use a single event with a conditional (if-then-else) statement inside, which has the variable value as the condition, ie, if davenport_living, go down, else go up

Hope that helps! Let me know if you have any further questions about this. If this solves your problem, please mark this post as the Solution.

Many thanks,
Geoff @ TechLeap

1 Like