Пример #1
0
    // Start is called before the first frame update
    void Start()
    {
        // Create instance for the PID (not attached to GameObject)
        _pidController = new PIDController();

        // From same GameObject
        _anim          = GetComponent <Animator>();
        _rb            = GetComponent <Rigidbody>();
        _feetIK        = GetComponent <IKFeetPlacement>();
        _projectedCOMs = GetComponent <ProjectCOM>();
        _terrain       = GetComponent <TerrainMaster>();

        // Get object to be balance (connected to joint) and change CoM if necessary
        _rbObjectConnected = hipsConnector.GetComponent <Rigidbody>();
        _rbObjectConnected.centerOfMass = _rbObjectConnected.centerOfMass + centerOfMassChangeUp * transform.up;
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     _terrainMaster = FindObjectOfType <DeformTerrainMaster>();
     _COM           = this.GetComponent <ProjectCOM>();
 }