How to make a gameobject clickable?

Hi, I want to make a Cube act like a button and when I click on it something will happen,
Can anyone help me with that?
Thanks

Put a collider on it and use OnMouseDown.

–Eric

1 Like

I do but anywhere I’ll click code will be play!

No, that’s not how OnMouseDown works at all.

–Eric