Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question best way of hitting one object with another in vr game

Discussion in 'VR' started by ab5050, May 24, 2022.

  1. ab5050

    ab5050

    Joined:
    Jan 21, 2022
    Posts:
    6
    Hi,

    I recently started looking into vr game development in Unity. I have created XR origin and now I can grab one object with hand in VR. I am using action based controller.

    I am wondering what is the best and most recent way of hitting one object with another? like a box or enemy in game scene

    can you tell me how you would do it? what functions and variable you use? where you place scripts? what settings you put for each object etc.?

    So I already saw OnCollisionEnter. What I am mainly look is what is the best practice in this area.