Search Unity

Resolved I want to execute an event function when the laser pointer touches the plane image.

Discussion in 'VR' started by unitsume, Dec 19, 2022.

  1. unitsume

    unitsume

    Joined:
    Oct 7, 2022
    Posts:
    31
    Hello!

    I'm using Oculus Integration to create an app for Meta Quest2.
    I want to execute an event function when the laser pointer touches the plane image.
    I tried it in the following way.
    But, the execution result behaved as if the Event Type were set to Pointer Click.
    How do I succeed?

    1. Set OVRCameraRig in the hierarchy
    2. Added OVR Physics Raycaster to OVRCameraRig
    3. Set UIHelpers in the hierarchy
    4. Enable Laser Pointer in UIHElpers>LaserPointer
    5. Set an empty game object in the hierarchy
    6. Add a C# file with event functions to an empty game object
    7. Set the texture type to sprite (2D and UI) in the button image inspector
    8. Set the button image in the hierarchy
    9. Add Box Collider to button image
    10. Add Event Trigger to button image
    11. Set items for button image event triggers
    Event Type : Pointer Enter
    Runtime Only
    empty game object
    C# function specified in step6

    If you need any other information, please ask.
    Thank you.
     
  2. unitsume

    unitsume

    Joined:
    Oct 7, 2022
    Posts:
    31
    Problem solved.
    I was able to solve it by trying a method that does not use UIHelpers.
    I used this site as a reference. This is a Japanese site, but I will introduce it.
    https://mono-pro.net/archives/7834