Click on an object to make another one move only once

Hi. How can I make the interaction “when clicked” (X object) possible to use it only once and never be activated again?

I want to click on an object to make another one move only once, but it keeps moving every time the first object is clicked. How to make this active only once?

One way of doing this would be to change the “pointer events” property of the thing you are clicking to “none”, after it does whatever you want it to do.

The “pointer events” property allows you to specify whether an object responds to dragging or clicking.

Here I have a visual script interaction on the “drive” button. When it is clicked it moves the car to the left by 600 pixels, then the button becomes inactive by switching off the pointer events. Here is a link to the remixable project.

You could instead toggle off the button’s “visible” property, which would hide it altogether.

1 Like