Layer Setup Question

jasontuttle

New member
I'm trying to use the new Third Person Controller on an existing project. My project already has layers setup in some of the slots that the setup wizard is trying to use, so the layer setup wizard didn't manage to set up all of the necessary layers.

I tried manually adding the necessary layers to other available empty slots, and it sorta works. One thing I'm seeing though is that when I enter play mode, my character's rig goes from being assigned to the "SubCharacter" layer to being assigned to my "Enemy" layer which is in slot 30, i.e. the slot number the setup wizard would have liked to have used for the "SubCharacter" layer. When I exit play mode, the rig goes back to being assigned to the "SubCharacter" layer.

Is this layer setup going to cause problems?

Do the layers that the Third Person Character Controller requires have to be in the exact numerical slots the setup wizard specifies?

Thanks!

: )

J
 
Quick follow up. -- This may be related, so I think it's worth mentioning: With my current manually configured layer setup, my character will not collide with objects in my "Environment" layer. My Physics settings are on the default settings, i.e. everything should collide with everything else. My "Environment" layer is in slot 8 which the UCC setup wizard uses for "PostProcessing", so I think that's probably another side effect of this non-standard layer setup.
 
You'll want to adjust the layers to fit the project that you already have setup. In this case you won't be able to use the setup wizard. In this case if you adjust the LayerManager with your new layer indexes it should get most of them, but you'll also want to adjust the layers on the weapons so they apply to the new set.
 
You'll want to adjust the layers to fit the project that you already have setup. In this case you won't be able to use the setup wizard. In this case if you adjust the LayerManager with your new layer indexes it should get most of them, but you'll also want to adjust the layers on the weapons so they apply to the new set.

Thanks Justin! -- Making adjustments to the LayerManager component solved most of the issues.

The one remaining issue is that my character's rig is on the SubCharacter layer which appears to be the default way that UCC sets things up. When I press play though, the rig and all of it's children switch to the Enemy layer. My Enemy layer is in layer slot 30. The default location that UCC uses for the SubCharacter layer also appears to be slot 30. Is there something in the UCC code that checks a characters layers at runtime and reassigns them if necessary?

Thanks for all your help on this!!

: )

J
 
Do you have the ragdoll ability? It may be changing this within Ragdoll.EnableRagdoll.
 
Do you have the ragdoll ability? It may be changing this within Ragdoll.EnableRagdoll.

Yes, I do have the ragdoll ability. -- I checked the Ragdoll layer property and it was set to Player. Looking at the code for Ragdoll.EnableRagdoll, it looks like the default layer is Character? I tried setting it to that, but it didn't help. When I press play, the rig and all of it's children switch to the Enemy layer.
 
Also, jump seems to be broken. When I reset the Layer Manager to its defaults, jump works, but if I make the necessary changes to the layer manager to fix my collision issues, jump stops working.
 
Quick follow up for clarification: Looking a the code for the Layer Manager, I can see the default layers UCC specifies for Enemy Layers, Invisible Layers, and Solid Object Layers. I've set my character to match those defaults. The only additional change I've made was to add my Environment layer to the Solid Object Layer.
 
SOLUTION:

The problem definitely has something to do with the ragdoll ability. If I create a character WITHOUT the ragdoll ability, the rig stays assigned to the SubCharacter layer when I enter play mode. If I create a character WITH the ragdoll ability, the rig always switches to the Enemy layer when I enter play mode.

I tried editing all of the various layer properties on the various character components (i.e. Layer Manager, Ultimate Character Locomotion, etc.). Unfortunately, that didn't work. Maybe I missed a layer property somewhere?

The only solution I could come up with to solve this problem was to edit LayerManager.cs. Specifically, I changed the custom layer constants to match my project's layer setup:

// Custom layers
public const int Enemy = 30;
public const int MovingPlatform = 29;
public const int VisualEffect = 28;
public const int Overlay = 15;
public const int SubCharacter = 16;
public const int Character = 17;

Then, I built a new UCC character from scratch, and it worked perfectly.

Thanks again for all your help!

: )

J
 
That solution looks correct. I'd like to find a better way to have custom layer indexes without having to modify the actual file.. the trouble is that these values need to be const so you cannot declare them as an instance variable.
 
Top