I have 2 cubes, I want them to collide with one “falling” upward and the other downward, i tried to make the mass -1 but it set it to 0.001kg and not -1. How can I make it “fall” upwards
-
$\begingroup$ @Edgel3D that would work if i didnt need them to not fall back down when they collide $\endgroup$– TopcodeNov 16, 2020 at 19:39
-
$\begingroup$ Maybe you could simply animate it by keyframing the location? $\endgroup$– StraightUp636Oct 7, 2021 at 20:46
-
$\begingroup$ @StraightUp636 while that would work, it would be a lot of effort for it to look good. $\endgroup$– TopcodeOct 7, 2021 at 21:40
2 Answers
Mass is different than weight. Having a negative mass would cause all sorts of physics problems.
There's no easy way to flip the gravity for one object without flipping it for all. However, what you can do is create a wind forcefield pushing one of your cubes up. I'm no expert so there could be a better way that I'm not aware of.
A couple of ideas:
Keyframe the cube moving upwards and keyframe the rigid body physics to on at the point of or shortly before the collision. Just make sure to set the motion keyframes to linear, or the motion will slow down considerably because it will try to ease the speed to stationary at the end.
Alternatively, bake the upward moving cube with negative gravity by itself first, but bake it to keyframes so that the animation is preserved and won't be reset with a new bake. Simply get rid of the keyframe a frame or two just before and beyond the point of collision. Again, keyframe the rigid body physics to on at the correct point. Also note that gravity is limited to a floor of -0.5, so the motion will be much slower for the rising cube, and you will probably need to remove every other keyframe and collapse the remaining keyframes down to be sequential animation frames.
The second option will create a more realistic simulation but will take a lot more work, especially if it is a lot of frames, while the first would be much easier to implement, but not as realistic motion on upward motion. You have to get a little creative to make two opposing physics models apply to the same space, but a lot, if not most, of 3D modeling and animation is just creative problem solving.