- Home /
How can I slow Gravity
I would like to slow the gravity on the Character Controller. How would I go about doing this? Would I need to have a rigidbody or can it be done through the CC?
Answer by Siloaman · Jun 26, 2015 at 03:44 AM
by their nature, character controllers dont obey the game engine physics rules like rigidbodies do. character controllers move exactly where you tell them to go by script. I assume that if you already have a fall speed, you should add more code to change the fall speed every few seconds.
example:
timer = 0;
if(!isGrounded){
timer += 1 * Time.deltaTime;
if(timer < 2) move speed equals 5
if(timer > 2 && timer < 5) move speed equals 3, etc..
Now if your question is actually about affecting the game engine gravity itself( like for rigidbodies) you can decrease it by changing Physics.gravity = new gravity
Answer by Eiyon · Jun 26, 2015 at 01:27 AM
It pretty much depends on your game's physics. if you have a rigidbody attached, do it with rigidbody. for example:
getComponent().AddForce(transform.up * someAmounts),
and if you want to set it on some amount just set the gravity itself.
or you can manipulate the transform.position.y in the same way;
Thanks, I've done it a little differently than this but thanks anyway!