Hello my fellow Unity enthusiasts,
I am trying to activate the gravity of an Object when it is grabbed and I would like to do that via a script that the object itsself has.
This means I want the Object to detect, that it is being grabbed and not the Controller recognizing that it is grabbing something and then have to get the Object the Controller is holding.
When the Object recognizes it is being grabbed I want to execute the following line of code:
gameObject.transform.parent.gameObject.GetComponent<Rigidbody>().useGravity = true;
Don’t worry about the parent thing, I have disabled the box that makes the hand a parent automaticaly.
If you need any further information feel free to ask, I will provide you with everything you may need.