Pointer Event on 3D model

I have imported an .obj file to my project, and added it to the root hierarchy. I want to change the skin of the object on pointerdown (or up). I have tried adding an eventhandler for “pointerup” event to the object symbol, and to the internal object (in the symbol). I couldn’t get any of them to work.
My project hierarchy:
root
L myObject1
L show
L hide

and the myObject symbol hierarchy:
root
L object_file

How do I add the eventhandler, so that I can tap my 3D-model and change things like skin or color?

1 Like

Hi Anders,

Studio doesn’t currently support ‘pointer’ events on 3D objects, but there is a workaround.

What you could do is:

  1. Create a new group in the hierarchy and place the 3D model node inside it.

  2. Create a new plane and add it to the same group.

  3. Make sure the plane is positioned in front of the 3D model, and that it’s below the 3D model node in the hierarchy.

  4. Untick the plane’s visibilty property.

  5. Create a new ‘pointer’ script on the plane, and add a reference to the model by dragging its node into the top of the script and selecting 'insertLocalVariable. This will let you change the 3D model’s properties from within this script.

By following these steps, you can make it seem as though the event is occurring when you tap on the 3D model.

Hope this helps.

Thanks,
Seb