addFollower() public method

public addFollower ( GameObject obj ) : void
obj GameObject
return void
	private void createFollower(MoCapRigidBody rigidbody){
		// create object
		GameObject obj = (GameObject)Instantiate (rigidBodyObject);
		// make it follow the specified rigidbody (always adopt its position and rotation)
		rigidbody.addFollower (obj);
		// make the new object a child of our main object (this)
		obj.transform.SetParent (this.transform);
	}
Example #2
0
    private void createFollower(MoCapRigidBody rigidbody)
    {
        // create object
        GameObject obj = (GameObject)Instantiate(rigidBodyObject);

        // make it follow the specified rigidbody (always adopt its position and rotation)
        rigidbody.addFollower(obj);
        // make the new object a child of our main object (this)
        obj.transform.SetParent(this.transform);
    }