Search Unity

How to Remove Component at Runtime

Discussion in 'Scripting' started by UNITY3D_TEAM, Sep 4, 2012.

  1. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    how to remove constant force (component)at run time
     
  2. Marrrk

    Marrrk

    Joined:
    Mar 21, 2011
    Posts:
    1,032
    Get the component (GetComponent with ConstantForce as parameter) then call Destroy(theConstantForceComponent); on it. Done :)
     
  3. UNITY3D_TEAM

    UNITY3D_TEAM

    Joined:
    Apr 23, 2012
    Posts:
    720
    thanks i got it now