Movement: Swimming
It's summer. High time we teach our sphere how to swim!
Comments (5)
With the removal of axial bias in the Rolling tutorial, this has been somewhat improved, but the weakened buoyancy effect can be clearly seen when buoyancy is somewhat close to gravity, e.g. 1.2. Then without playerInput buoyancy is really low, but if playerInput is applied (even if not on y axis), then the vertical component of the movement increases.
Trying to maintain position is intentional, also vertically while in the water. Changing behavior based on whether the up-down input is (close to) zero is fine if you prefer that. It does cause sudden buoyancy force changes though.
Thank you for the great tutorials, I've learnt a lot from you. I have a suggestion for this one: At the end of AdjustVelocity, when Swimming is true and assuming the user is not touching the controls, we still move vertical speed towards 0, which ends up decelerating the effect of buoyancy. So while I can enter buoyancy of 2 (expecting a buoyancy as strong as gravity), the effect is much weaker. My suggestion is maybe only adjust the vertical component of velocity only when swimming AND playerInput.z is not zero.
Legend. Thanks, Jasper!
You're welcome!
