Hey folks!
I’m currently working on a little game that involves a fish as the main character.
To get it done right, I’d like the fish to be controlled by the player, but make it feel like he’s under water also.
There’s a couple of ways to do it that I’m playing with in my head, please give me your advice on what you think is best.
I could make the fish a rigidbody without gravity and have him move around by applying forces, to give it a floaty feeling.
Also I could use a character controller and manually code the damping on movement.
What would you do in my situation?
I’d love to get your ideas before I start coding on this one.
Thanks so much in advance.
Cheers!
-TT
I like your rigidbody idea best because the physics will make it feel more ‘swimmy’ because of inertia. You’ll have momentum and won’t stop when you stop swimming, you’ll coast to a halt.
The part that might get a little hard is when the fish / player turns, because fish bodies are very efficient at moving in a forward direction, you’ll need to turn the momentum of the rigidbody as the fish turns.
Thanks man.
I tried the rigidbody first but it was a horrible disaster when the collider hit something in the world: the character spins uncontrollably and since gravity is off, it’s rolling in mid-air.
Unfortunately.
So I used the character controller method instead. Still working on getting the de/acceleration smooth but it’s working like a charm!
-TT