Search Unity

Frisbee Physics in VR

Discussion in 'Physics' started by ViggeBoi, Jun 16, 2022.

  1. ViggeBoi

    ViggeBoi

    Joined:
    Jun 20, 2019
    Posts:
    6
    I'm trying to add some frisbee physics to my VR game, but I don't know how to get the spin, curve, lift and all that. I've tried to add some lift but I only want it to work when you throw it properly. Here is the code for what little I've come up with so far.

    Code (CSharp):
    1. void Update()
    2.     {
    3.         if (throwed)
    4.         {
    5.             if (Physics.Raycast(transform.position, Vector3.down, 1, groundLayerMask))
    6.                 throwed = false;
    7.  
    8.             float lift = Vector3.Dot(transform.forward, rb.velocity) * liftForce;
    9.             rb.AddRelativeForce(transform.up * lift);
    10.         }
    11.     }
    Can someone tell me how I would implement some realistic frisbee physics?