- Home /
Erratic behavior of sphere and AddForce?
I'm trying to just push this sphere around a bit, for my pong clone, but it seems to... not work. The sphere Begins to move left (not right), then move up, and down, and all around. Sometimes it somehow breaks its Configurable Joint constraints and moves out into the distance. I really have no idea what is going on. Probably a rookie mistake, a silly error. We'll see.
I have a prefab with one object it in it, the 'ball'. The ball is just a sphere, with a Sphere Collider, Rigid body (which ignores gravity (on purpose!)), a Configurable Joint that locks movement on the Z axis. Also, this script:
var ball : Rigidbody
function Start() { ball.AddForce(Vector3.right * 50) }
The ball, like I said above, moves to the left (very slowly) at first, then starts acting all... strange.
Answer by StephanK · Aug 10, 2010 at 05:06 AM
Probably you haven't configured the joint to use worldspace for its constraints, so when the sphere rotates the local coordinate system changes and therefore the constraints change as well.
Hmm... I'm not sure I see what you're talking about. I set the Z$$anonymous$$otion to Locked, and the Angular Z$$anonymous$$otion as well. It bounced back and forth twice before it went crazy tho this time xD
I locked all the Angular motions, that seems to have done the trick...
Ahahaha scratch that. It lasts for a bit, and THEN goes crazy ._.
Cheers that worked, on the configurable joint is a tick-box option called. "Configure in World Space" Turn this on if you have local rotation.
Your answer
![](https://koobas.hobune.stream/wayback/20220613070911im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
re-orienting velocity 1 Answer
A sphere moved by relativeforce is acting wierd? 2 Answers
Sphere vs Capsule collider collision resolution 0 Answers
Addforce.forward on a sphere object 1 Answer
multiple spheres spreads out 2 Answers