Configure capsule collider

Haytam95

Active member
Continuing from this post, where @Andrew and I were discussing about a preset for UCC Characters, now I'm able to create them from this Prefab by creating a Prefab variant with the model:

1594338933331.png



The trouble is now, with the Capsulle Collider, I think I've configured it correctly, but the character keeps falling through the floor:

1594339015213.png

1594339047880.png

I'm missing something? The pivot point is the foot of the character, but at runtime it changes to the middle of the character
 

Andrew

Moderator
Staff member
So he's not actually falling all the way through the floor, but the capsule collider's central position is just getting changed at run-time, right?

In your first screenshot you haven't got the Second End Cap Target field set - you should set this to the transform of the character's head. However I see you've set it to something in the second screenshot?

Also, as you're spawning it from a prefab variant, do double-check that the correct transforms are being referenced
 

Haytam95

Active member
At runtime, there is a gameobject created called EndCap that takes place at the top of the collider.

During editor:

1594395236581.png

During runtime:

1594395370498.png



I think the trouble is, that for some reason, the pivot point of the character is moved at runtime to the center. You can see that in Editor mode, the pivot point is at his feets, and at runtime it moves to the middle of the character.

That doesn't happen if I create the character manually.

1594395801442.png
 

Justin

Administrator
Staff member
The collider looks correct, it's just a problem with the animation. I'm not super familiar with this so I'm not able to help much, but it does look like the animation isn't completely matching with the character rig which is then causing the problem. I'm not sure why it would only be affected by a prefab.
 

Haytam95

Active member
I'm not sure that the trouble is the Animator, I tried disabling it and the problem continues.

Also I've created an empty gameobject at the feet to assign it as First end cap target but it's being moved aswell. I triple checked the transform local and global position, to ensure that I don't have anything dirty and it's just fine.


Apparently, the trouble is when I create a new character from Abstract Controllable Character (don't really know why), if I start from a variant that is working (the girl main character for example), and save it as a brand new prefab (still a variant of the Abstract Controllable character prefab) the thing is working.

Weird stuff really, some kind of trouble with unity prefabs I think.

Anyway, thanks for your time @Andrew and @Justin
 
Top