Cannot Swim if Body in Inventory

Arachai

Member
I am using Unity version 2021.3.32 and have noticed that if I have the body item set to 1 in the characters inventory they cannot swim. However if I set the body item to 0 then the character can swim just fine. I did this in the demo scene of the swimming add-on itself and have this issue. I can dive and swim underwater no matter if the body is set to 0 or 1 but as soon as i hit the surface motion is dead in the water.

I have used fresh characters as well as the Atlas character, created to projects and still get this issue no matter what I do. Any help is appreciated!
 
What state is the full body animator in? Is it the swimming state? I will let you know after I have a chance to try out this scenario.
 
Here is the Full Body Layer; as you can see the character goes into idle mode yet also is in an idle swimming mode:
1705125964630.png
1705126026641.png
The character rotates to the direction you're pressing but will not move at all..
1705126149043.png

Oddly enough I found tonight that it's not only the body but the entire Default Loadout: I enable the Assault Rifle and disable everything else and it is the same issue. If I disable everything in the Default Loadout then swimming will work as expected.
 
It doesn't look like the state is transitioning. Does the forward movement value change?
 
This has to have something to do with the Inventory script because the Swimming Atlas does NOT have an inventory script attached yet the Atlas character does and where I'm seeing the bug is in the Default Loadout!!

Forward Movement does fire but No Movement occurs if anything in the Default Loadout is Set to 1. If I set all of Default Loadout to 0 Forward Movement Fires and Movement occurs...

Now this is exactly how it goes: I dive into the water with Body set to 1, Pistol set to 1 Assault Rifle set to 1. I can swim underwater but as soon as I surface the issue starts.

The same if i walk into water. I will swim until I release the Forward key. Upon going Swim Idle I cannot move again even though Movement is firing.

Now if I set Body, Pistol and Assault Rifle to 0 then everything works as it should. I can swim and go Idle and continue to Swim again.

With anything set to 1 on the Default Loadout the issue occurs.
 
Last edited:
Confirmed: The issue is something in the Inventory script; as soon as I disable it I have movement.
1705349167968.png
And Swimming Atlas is Default with NO Inventory Script attached:
1705349212662.png

So now the question is: How do I find what is wrong in the scripting?
 
It looks like there's an extra condition in the animator that needs to be removed. The transition from surface idle to swim should only have these two parameters:

1705348817840.png
 
Top