[SOLVED] How to Enable and Disable entity on mouse click

it didnt work how i wanted it to

You don’t have to delete the other code. The idea was to switch when you click and switch back when you release.

so how would i do it, add another line of code similar to the first one but with the was pressed and disable and enable the opposite entities?

Exactly.

ok gimmi a sec lemme try it

would this work?

Almost. Both parts have to be in the same update function.

ok

this?

Replace line 11 to line 16, because this sign is the end of the update function.

this?

Yes. What is the result?

does not work…

So, what happens?

same thing that’s been happening, i hold right click it puts the scope overlay up but when i stop holding right click it doesnt disable the overlay

it doesnt work :frowning:

do you know anything that’ll work?

Sorry, I made a mistake. Can you try to replace wasPressed with wasReleased?

IT WORKS :slight_smile: thank you so much

1 Like

Yay