Hi i have 2 gameobjects Parent and Child. Child has a script when OnCollisionEnter with a wall it will call GetComponentInParent < Rigidbody > ( ). usegravity and set it to true. Whenever i run it the game the gravity seems to switch in the child not in the parent what i am doing wrong ? all of the objects have Rigidbodies and Colliders.
Thanks.
//Script attached to the child.
void OnCollisionEnter(Collision other)
{
GetComponentInParent < Rigidbody > ( ). usegravity = true;
}
If i want to access a script in the parent then GetComponentInParent < Parent Script > ( ) ; works with no problem.