- Home /
Constant force, with gravity, and correct collisions.
Hi,
I am looking for a way to have a constant force or velocity applied to a ball, as well as gravity that when it collides with a wall, it bounces off just as it would in real life.
I have tried a whole number of ways, such as setting the velocity to a speed every fixed update, this yields an unrealitic collision response when colliding with a wall.
I've also tried adding a force every fixed update, this still doesn't produce realistic collisions off the wall, on a slight angle the ball slides along the wall, rather than bouncing off.
How would I create a ball, that maintains a constant speed, that reacts to gravity, and bounces off walls realistically?
I'm stumped.
Thanks!
Try adding physics material to the collider. Tweak values accordingly.
I've already got a physic material to the ball with 0 frictions, and 0.45 bounce.
Answer by morbidcamel · Jan 15, 2014 at 06:15 AM
Hi I recommend understanding physic material better. http://docs.unity3d.com/Documentation/Components/class-PhysicMaterial.html
Also, make sure you are using proper colliders and your rigid body is configured correctly.
Answer by united4life · Jan 15, 2014 at 06:26 AM
I added physics material to the collider with bounciness = 1 and it is working fine. Make sure the hitting object should have rigidbody attached.
Your answer
Follow this Question
Related Questions
Why does a rolling ball not accelerate past a slow speed? 1 Answer
Planet gravity help need guidance no code 1 Answer
Bouncy Ball Game 1 Answer
Faux Gravity Prolem? #2 2 Answers