I am working on a test as I learn the game. I decided to make game that I have launching a boxcollider using addforce. What I am trying to do is add a child that is really just there for art and does not have a rigidbody or collider coomponent. The user will also be able to change the art object. I found that whenever I add this child and launch it I lose some distance, like it is adding more mass to the rigidbody that I am launching because of the child, but it shouldn’t. I will have different types(sizes) of (art) objects I will be swapping out as the child, but want the force applied to the rigidbody to stay consistent no matter what object I add as a child since it is not a rigidbody and should not be calculated by the physics engine.
Please help or help me think of a work around for this? I looked through the manual and couldn’t find anything. I also tried to not add it as a child and use transform.position and transform.rotation to have it move with the rigidbody in fixedupdate, but I ran into the same problem.
As far as I can see, the ‘mass’ of an object is really more like its density, and the actual mass increases as the colliders get bigger and as more colliders are added.
Maybe you could tackle the problem by using ForceMode.VelocityChange with AddForce to ensure that the object is launched at the same velocity irrespective of its size.
But the collider never gets bigger. It would be great if there was a way for it to just ignore the child and continue to behave as if it had no child since the child really shouldn’t have an affect on physics if it is not a rigidbody or has a collider attached.
I’ts kinda like having a bowling ball and adding a bunch of flowers on it will make it affect it’s weight. That really shouldn’t happen right?
Mass is accurately named: “The quantity of matter that a body contains, as measured by its acceleration under a given force”. The larger the mass, the more force it takes to move it, which is independent of the size…given the same force and the same mass, a 100x100x100 cube will move exactly as far in the same amount of time as a 1x1x1 cube. Adding a child with no rigidbody and no collider won’t have any effect on the parent, and in fact can’t have any effect because it’s not part of the physics simulation, and adds no variables to the system. Also I’ve done something similar several times so I know from first-hand experience. Make sure there aren’t other factors involved that you might be overlooking.
Quite right, I just re-tested this and got the result I would have originally expected, which is what you described. Funny, I recalled it behaving more like density the last time I tried. I must have missed something.
Actually yeah I am adding the force in update not fixedupdate. Let me change that and see if that helps(I think it will). I’ll let you know what happens and provide the project/script if it still doesn’t work.