Character gets stuck easily on the terrain and then falls off the ground

dgkoris

New member
Hi,

I'm using the first person controller as it was from the FirstPersonControllerDemo and when the ground is uneven he sometimes gets stuck and then falls off the ground.

It happens at random places when the ground is slightly uneven, but not always on the same spot. In the video I'm posting here the character is stuck on a terrain he usually manages to walk and then when I try to move back he falls off the ground. https://drive.google.com/file/d/1xYHJdEi079YWb26w4WjoCfqJdD_SyTk-/view?usp=sharing

I'm using the latest Unity terrain system. I tried to change the Rigidbody Collision Detection from Descrete to Continuous Speculate and it didn't help.

Increasing the height of his Capsule Collider from 2.05 to 2.25 seemed to help, but the footsteps can't always be heard because they don't always touch the ground.

Can anyone recommend what else I could try?

Thank you so much.
 

dgkoris

New member
Can you send me a repro scene?
Hi Justin,

The issue doesn't always happen. Yesterday I managed to do it a few times, but today I had no luck.

What it seemed to be happening was the player's feet were stuck at random places and he couldn't move and after a while he was falling down.

I will keep you posted if it happens again and I manage to figure out the exact conditions it happens. If I find the exact conditions, then I will be able to send you a repro. I was just hoping that from the description you could figure out what could be done. For example increasing the height of the capsule collider seemed to fix it, but it's hard to say as today the problem didn't occur at all with the old settings.

Dimitris
 

Justin

Administrator
Staff member
Unfortunately for collision detection cases like these there is no one cause and I need to dig into it. The next version, 2.1.5, does have some collision improvements so when that is released it may help.
 

dgkoris

New member
Unfortunately for collision detection cases like these there is no one cause and I need to dig into it. The next version, 2.1.5, does have some collision improvements so when that is released it may help.
I tried to isolate the problem on a repro project andit never happens there, but it happens in several playthroughs in the full game (just today!).

It happens on the volcanic terrain just by walking on it, even when the character was never teleported or jumped. It happens with the character we created and also with Nolan straight from the demo scene.

In another identical terrain with grass it doesn't seem to happen.

In the repro, we have the exact same volcanic environment, but the problem never happens. Therefore, the repro won't help you unless you are extremely lucky to replicate it and sending you the whole project is impossible.

I noticed there is a function GetDominantTerrainTexture in SurfaceManager and there is a SurfaceIdentifier script which is attached to the Capsule Collider. Do you think that the problem lies somewhere in the surface scripts and specific type of textures?

Dimitris
 

dgkoris

New member
I tried to isolate the problem on a repro project andit never happens there, but it happens in several playthroughs in the full game (just today!).

It happens on the volcanic terrain just by walking on it, even when the character was never teleported or jumped. It happens with the character we created and also with Nolan straight from the demo scene.

In another identical terrain with grass it doesn't seem to happen.

In the repro, we have the exact same volcanic environment, but the problem never happens. Therefore, the repro won't help you unless you are extremely lucky to replicate it and sending you the whole project is impossible.

I noticed there is a function GetDominantTerrainTexture in SurfaceManager and there is a SurfaceIdentifier script which is attached to the Capsule Collider. Do you think that the problem lies somewhere in the surface scripts and specific type of textures?

Dimitris
PS.: I do get sometime "ArgumentException: Invalid argument for GetAlphaMaps" in SurfaceManager.cs line 842 while walking, but this is not when the player stucks and then falls off. I just thought I should also mention this.
 

dgkoris

New member
Since it is not happenning in the repro project, I have recreated the terrain in our full project (using Gaia is easy) and I will come back to you to let you know what happened.
 

Justin

Administrator
Staff member
I noticed there is a function GetDominantTerrainTexture in SurfaceManager and there is a SurfaceIdentifier script which is attached to the Capsule Collider. Do you think that the problem lies somewhere in the surface scripts and specific type of textures?
Unless you are getting an error I don't think that it is related. We will be releasing version 2.1.5 soon and hopefully that'll help instead of having to track down a set of repro steps.

PS.: I do get sometime "ArgumentException: Invalid argument for GetAlphaMaps" in SurfaceManager.cs line 842 while walking, but this is not when the player stucks and then falls off.
What type of shader are you using on your terrain?
 

dgkoris

New member
Unless you are getting an error I don't think that it is related. We will be releasing version 2.1.5 soon and hopefully that'll help instead of having to track down a set of repro steps.


What type of shader are you using on your terrain?
I'm getting an error, but not always and it's not when the player is stuck and then falls down. I got the assets from NatureManufacture. Here are the sceenshots. I have also a PigmentMapGenerator script and Pigment map doesn't seem to affect this, because the problem is still there without the script.
 

Attachments

dgkoris

New member
Also, when a new update comes up it is usually recommended by the developer to delete first the existing files. This means I will have to create my character again and I've spent too much time working on this.

It was supposed to be a quick solution and it's not working with the PlayStation controllers either (not only with the motion controllers, but also with the standard controllers), so the only reason I'm still using this is because I have repeatedly asked for a refund and you are not giving it to us, so I decided to keep it to just play test the game. I don't think I'm gonna spend all this time again to setup a new character when the update comes.
 

Justin

Administrator
Staff member
When the new update comes out you don't need to recreate your character - only replace the files. The metadata guids haven't changed so you can keep your character.

I will add a check to prevent you from getting that alpha map error.
 

dgkoris

New member
Hi Justin,

Well done, I updated to the new version and the character doesn't fall through the terrain anymore.

I get some errors "EventHandler.GetActionList error: target object cannot be null.". The way I updated was by completely removing the UltimateCharacterController folder and imported the new one. I will open a new thread if you wish, because it's a separate problem.

Thanks again.
Dimitris
 

Justin

Administrator
Staff member
Great to hear about getting stuck!

For the ErrorHandler is it related to one of the thread below? If so adding more details to one of those threads would be great. Also make sure you completely download a new version of the asset as there was an update last week with the same version. If it's separate then can you create a new thread with the full stack trace?

 

dgkoris

New member
Thankfully it's not related to any of those issues and everything works fine. I fixed the error which was only on Unity Editor and it was specific to my project so it doesn't worth your time.

The only error I'm getting now is the following which doesn't seem to cause problems, but I can't understand what it actually means. I'll have a look tomorrow as today I didn't have time to look into it.


Error: The state AlignToGround on Player (Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion) does not have a preset. Ensure each non-default state contains a preset.
UnityEngine.Debug:LogError(Object)
Opsive.UltimateCharacterController.StateSystem.StateManager:InitializeInternal(GameObject, IStateOwner, State[]) (at Assets/Opsive/UltimateCharacterController/Scripts/StateSystem/StateManager.cs:103)
Opsive.UltimateCharacterController.StateSystem.StateManager:Initialize(GameObject, IStateOwner, State[]) (at Assets/Opsive/UltimateCharacterController/Scripts/StateSystem/StateManager.cs:67)
Opsive.UltimateCharacterController.StateSystem.StateBehavior:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/StateSystem/StateBehavior.cs:27)
Opsive.UltimateCharacterController.Character.CharacterLocomotion:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:307)
Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion:Awake() (at Assets/Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:274)
 

dgkoris

New member
Hi,

Unfortunately, I can't figure out what this error means. I debugged it and the AlignToGround m_Preset is null, as soon as I hit Play (screenshot attached). This error wasn't there in the version I had before when the charcter was falling off the terrain.

I looked into other posts and they have trouble when teleporting, but I'm not teleporting my character in this case. Thankfully it doesn't occur anywhere else, even when I teleport, so I could remove this check if it's not important?
 

Attachments

Justin

Administrator
Staff member
That error indicates that the state AlignToGround on the UltimateCharacterLocomotion component doesn't have a preset. You should remove this state from the state list on the UltimateCharacterLocomotion component.
 

dgkoris

New member
Thank you, this worked. Feel free to close this thread if you wish, as the reported bug is fixed in the new version and there are no other problems.

Thanks a lot.
 
Top