- Home /
Have I to disable the gravity to drag an object?
Hi!
My problem is that I have a 3rd Person Controller, and I want to grab the character and drag it to the air, but when I do it, it began to do like Daffy Duck when is crazy, if I go to the code and I disable the calculation of gravity, the behavior dissapear. But I'm wondering if this is a good way to get my objetive.
Thanks!
Answer by reptilebeats · Aug 21, 2012 at 11:43 PM
dont change the gravity settings this could mess with other stuff in your game, instead use isKinematic on the rigidbody this will stop the player behaving to the physics engine like gravity
yes, that is the thing, I'm not using a Rigidbody, I just have a charactercontroller and I have a vector of movement, and I add the calculation of gravity to that vector, something like the example of 3rd person controller that comes with Unity: if($$anonymous$$oveVector.y > -Ter$$anonymous$$alVelocity) $$anonymous$$oveVector = new Vector2($$anonymous$$oveVector.x,$$anonymous$$oveVector.y - Gravity * Time.deltaTime);
So, what is better?? Use just a CharacterController whit some code like this, or try to work with a rigidbody?
Your answer
![](https://koobas.hobune.stream/wayback/20220613080007im_/https://answers.unity.com/themes/thub/images/avi.jpg)