- Home /
AddForce made a ball fall with no accelleration
Hi all, I hope I do not ask a stupid thing with this question.
I have a ball with rigidbody and a script that uses:
// This code is simplified for example
void Update(){
if(Input.KeyCodeDown(KeyCode.Space))
rigidbody.AddForce(new Vector3(0, 0.2, 1) * forceModifier);
}
Why the ball have the same speed when it goes up and when fall? What's wrong in my code?
Answer by dre38w · Nov 22, 2012 at 04:21 PM
Try using ForceMode.Acceleration. Because if I'm not mistaken the default ForceMode is ForceMode.Force. Which will add a constant force. Acceleration adds a constant acceleration to the rigidbody.
Thank you for answer but it doesn't work.. with Accelleration the ball jump away with an high speed..
$$anonymous$$y rigidbody properties are:
Drag: 0.1
$$anonymous$$ass: 5
Well, Acceleration ignores the mass. Use Time.deltaTime and multiply that by force$$anonymous$$odifier. This is all off the top of my head but see if that'll work.
Your answer
Follow this Question
Related Questions
Ball physics help 2 Answers
Speed Cap for Rolling Ball 1 Answer
Kick a Ball - Add Force? 2 Answers
Get a free moving ball. 1 Answer
Update speed and physics makes my rigidbody jiggle 2 Answers