Starter Asset Prefab jumps infinitely

I have imported the Starter Asset - Third Person Character Controller into my project, everything works fine. Then I copy pasted everything from the Player prefab to another character, to see if it works.
The 2D movement, i.e. walking, sprinting works fine, ramps etc. too, but if the character jumps, it never comes down and just keeps repeating the jump animation. Additionaly, if the character walks of an endge, it floats down slower than the prefab and without the falling animation.

Since everything is copied over, is it an issue with a script, or is something important missing?

Here is the prefab’s configuration:7856029--997150--Unity-Bug-1.PNG 7856029--997153--Unity-Bug-2.PNG

And the new character’s:7856035--997156--Unity-Bug-3.PNG 7856035--997159--Unity-Bug-4.PNG

ANNOProfi, have you solved this issue yet as I have the same problem. I note that the Grounded and Jump parameters are both ticked in the animator, but I am not sure why the code works for the stater asset armature, but not for my prefab.

1 Like

I suspect it has to do with the layers on the new Game Object. The system uses the layers to determine which colliders are part of the ground and which are part of the character itself.8169869--1063253--upload_2022-5-31_8-59-32.png

There’s a field on the Third Person Controller to specify which layers are considered Ground Layers. I suggest moving the new Character to its own Layer called something like “Character”.
8169869--1063262--upload_2022-5-31_9-1-4.png

4 Likes

yup, this works.

2 Likes

I also stumbled into this behavior when importing the standard asset into an existing project to do some quick scene prototyping. Debugging this definitely broke my “quick prototyping” flow.

Perhaps Unity could add a check into Awake() of the Ground Layers -vs- the “Player” tagged object’s layer to LogWarning the developer if their player GO layer is in the GroundLayers layer mask?

This is what I’ve added to my FirstPersonController.cs

if (GroundLayers == (GroundLayers | (1 << gameObject.layer))) {
    Debug.LogWarning($"WARNING: Player layer {LayerMask.LayerToName(gameObject.layer)} is also in the GroundLayers. Jump will go forever. ", gameObject);
}

CHanging Layer of Player Armeture helped. It was empty when I imported.

1 Like