Weird Rigidbody Behaviour

So we’ve come across an interesting little hangup with rigidbody’s which appear to have a ghost force being applied to them.

Demonstration
** The barrel at the end was from the ball I guess, I noticed that after, seemed a little excessive though **

Some things to note …

  • Any non kinematic rigidbodies (or if I turn off isKinematic while in effect) will instantly have the ghost force applied
  • No force is being applied via code to these things, only once during a throw call to the balls
  • Gravity is default, timescale is not touched
  • They’re not inside of a collider

Anyone seen this behaviour before? ideas?

Unity 3.5.5f3 / Mac / iOS build

@Reapazor
I can theorize that you have a swipe motion or a before and after behavior that calculates the trajectory of the ball. If that’s the case, you may want to put some sort of threshhold on the swipe so they have to move… let’s say 10 pixels before the ball is thrown. Otherwise, force would equal Vector3.zero or despawn and put the ball back in the right-hand holder.
I hope that theory helps.
-S

Well that would be correct should that force be the throw force doing that, we’ve verified that the throw force is identical in nature to good throws and bad.
The issue is that this “mystery force” is being applied to balls, anything with a rigidbody already in play … even ones that have settled … they all just suddenly go flying.

Thank you for the thoughts so far :slight_smile: I’m a little bit frustrated with this one :slight_smile:

I guess center of gravity is fine also?

If you make it so, that pressing T would throw it with a fixed amount of force,
does it still get some random force after that…?

Ya, center of gravity is auto calc’d, i tried forcing it to 0,0,0 as well …
The ghost force is randomly even being applied to objects in the scene that were not even thrown too.

I’ve tried the fix force throw as well, at one point I decided to have a force of 0 for the throw and for the first while the balls would just drop (yay gravity!) … then all of a sudden our ‘mystery friend’ showed up and the balls were going flying again at random …

Been using Unity since 1.x days … this one is new to me :slight_smile:

If you want to export small test scene, I could test it on my machine… (just the ball/script or what else is required for it to happen…?)
(send here for others also, or pm/email)

Every time I’ve seen things go flying like that it’s because the object starts inside a collider. I know you said it doesn’t, but… are you sure you’re not accidentally leaving behind a collider from the previous thrown ball when instantiating the new one? If you’re using coroutines to disable the thrown balls after some amount of time, it might be a timing issue with trying to instantiate a new ball while the old one’s collider is still in the launching position.

mgear: Might have too :slight_smile:

makeshiftwings: No collider, sadly … i wish it were that … and i agree thats the typical behaviour … mind boggled :slight_smile: This is a fun one.

bump anyone else have any suggestions?

Did you ever find a solution to this issue? I’m having fun with the same thing.

Same here, haven’t modified anything related constantForce or any properties of the rigidbody, when testing this started happening all of sudden with no apparent reason.

I even tried to delete all scripts from all elements with no success, the only variable is the rigidbody component, when I turn on the isKinematic option, or when i delete the rigidbody component, that “mystery force” disappear.

EDIT: I found the solution after 1 hour, in my case, was a bit dum (IDK if this applies to your specific cases guys)… The elements that showed that “mysterious force” were colliding with other elements before starting. So, what happened is that in order to separate those colliders Unity engine repelled them and that’s the reason of that mysterious force. Moving them away from those colliders solved the issue for me.