Jump to content

I'd like to know how to create an event after clicking on an object.


photo

Recommended Posts

Hi
I want to make the hidden box appear after clicking on the box.
but, I don't know what to do with xml and C#.
Like Unity 3d, Editor tries to create a script and apply it to the object, but it is not working.
I want to make the right cube appear when I click on the left one as shown in the picture below.
I'd appreciate it if you could tell me how.

image.thumb.png.1c14db31598240c43bca9c12197f40ba.pngimage.thumb.png.3ca0b3bcb493289cf96c9949982e4668.png

Link to comment

Hello,

I created a simple C# component CubeClick with an example like this. Add this component to any object in the world, and set the target cube and hidden cube. Clicking on the target cube will turn the hidden cube on and off.

CubeClick.cs

  • Like 1
Link to comment
×
×
  • Create New...