Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

argument 2 may not be passed with the out keyword PLZ HELP

Discussion in 'Scripting' started by jamesjac, Apr 9, 2021.

  1. jamesjac

    jamesjac

    Joined:
    Jul 19, 2015
    Posts:
    2
    why am I getting this error?? (argument 2 may not be passed with the out keyword)

    Code (CSharp):
    1. void FixedUpdate()
    2.     {
    3.  
    4.         RaycastHit hit;
    5.         if (Physics.Raycast(transform.position - transform.up, out hit, maxLenght + WheelRadius))
    6.         {
    7.             springLength = springStiffness * (restLenght - springLength);
    8.  
    9.             suspensionForce = springForce * transform.up;
    10.  
    11.             rb.AddForceAtPosition(suspensionForce, hit.point);
    12.         }
    13.        
    14.     }
     
  2. jamesjac

    jamesjac

    Joined:
    Jul 19, 2015
    Posts:
    2
    nvm I found the problem its in the 5th line instead of ""transform.position - transform.up""
    its ""transform.position, -transform.up""