I am making a VR game using the XR toolkit. I want to instantiate a gameobject and I want it NOT to move and just float in the air. After I grab it, it should have back the gravity/rigidbody etc. After I instantiate it i use the following code:
gameobject.GetComponent<Rigidbody>().useGravity = false;
When I pick it up and drop it I set the gravity on true which does the job. The problem is, when I don’t grab the object but hover with my hand over it or touch it, it starts flying and floating through the area. How can I make stop that? I’d be grateful if someone can help me out!