Swimming Pack Problems

feloxy

New member
Hello,

I am getting the following error when colliding with the water trigger. I sink in the water and hit the floor and cannot swim around in the trigger. If I stay still I can float to the surface but as soon as I press forward, It goes down until I hit the bottom. Also for some reason inside of this water trigger, the left and right strafe are inverted.

Thanks.
 

Attachments

  • swim.PNG
    swim.PNG
    14.4 KB · Views: 5
  • swim2.PNG
    swim2.PNG
    64 KB · Views: 6
To get started does the demo scene work properly?

In your error what is null? My guess is that the location is null which will happen when the character's neck bone isn't mapped. This bone is used to determine the depth within the water.
 
The demo works fine, asides the few visual bugs since I'm running lwrp. How do you map the neck bone properly? I am only using first person view with no third person, only arms.
 
I am only using first person view with no third person, only arms.
Ahh, that's the issue. The add-on assumes that you are using a full body character. Within Swim.cs you can add the following to line 154:
Code:
            if (m_Neck == null) {
                m_Neck = m_Transform;
            }
 
Ahh, that's the issue. The add-on assumes that you are using a full body character. Within Swim.cs you can add the following to line 154:
Code:
            if (m_Neck == null) {
                m_Neck = m_Transform;
            }

I added it, sorta works, but the whole capsule floats over the water. I'm guessing there's a way of adjusting that. Also now, my strafing always goes left, so if I press left, it goes left but if I press right it goes left....
 
I added it, sorta works, but the whole capsule floats over the water. I'm guessing there's a way of adjusting that. Also now, my strafing always goes left, so if I press left, it goes left but if I press right it goes left....

I adjusted the height with surface height adjustment. I still have the issue when pressing right strafe it goes left. This is only within the water trigger.
 
On the Swim ability make sure you select No Override for the Use Root Motion Position. This is under the General foldout. I just tested this setup in the demo scene without having a full body character and it worked.
 
On the Swim ability make sure you select No Override for the Use Root Motion Position. This is under the General foldout. I just tested this setup in the demo scene without having a full body character and it worked.
So when doing that, the swimming on top of water is ok but I can no longer go underwater. If I jump for a certain height in the water, I start bouncing up and down inside the trigger. I can move around while this happens but no underwater control.
 
Could I use the root bone of my FPS Arms? I tried specifying the root node, but still get the inverted strafing.
 
Moving underwater normally uses root motion and because you aren't using a full body character then that part is having issues. I will work on an update to allow it to work better with characters that do not have a full body.
 
Moving underwater normally uses root motion and because you aren't using a full body character then that part is having issues. I will work on an update to allow it to work better with characters that do not have a full body.
Thanks a lot, really appreciated.
 
You don't have to explicitly set anything for it to work, but it is recommended that you set the Character Locomotion's Previous Acceleration Influence value to 0 for smoother movement.
 
Top