Fbx character model with animation, hot to attach colliders?
Hi everyone! Well, i've been working for a while in a small project, and it's some kind of hack n slash, inspired by Bayonetta ( just for tell you the kind of game i want, with my limitations of course). The problem is that I imported a .fbx model from mixamo.com, that have his own animations and all... This was great at the beggining but i found that i cant attach colliders that didnt break the normal movement of the character. I dont know if i should use primitive colliders for all the parts of the body, or a mesh collider.. or if its a way to add colliders from import ( I saw something over there, but when I click on that option, nothing happens).
And thats all, if anyone can help me, would be great.
PS : I use a CharacterController for the movement of the character. Thank youu
Answer by trank101 · Nov 15, 2016 at 04:53 AM
I'm not sure of your exact scene setup, but I'll try my best.
If you imported a skinned mesh with animations, you should see the names of the joints in the hierarchy. These are game objects that can deform the mesh. They will be children of the main game object you put in your scene that has the Animator component. You should put colliders on these child objects and they should move with the animation.
This will cause a problem though with your character controller. If the colliders on the joints are intersecting with the collider on the character controller, this could cause the joints or character to move unpredictably. To avoid this, you want to put the character controller and joints on a different layer and then in the physics settings, adjust the collision matrix so that the two layers aren't able to collide with each other.
Thanks for the answer! Someone told me that I should use for the combat system SphereCast and BoxCast to avoid the problems with the character controller, and make it more simple.
You think that's better? Or should I keep with the colliders?
A BoxCast or SphereCast is great for weapon hit detection, but it isn't something you want to be using every frame. You should keep some kind of collider on your main character so you can move around, but the box/spherecasts should be done by your enemies and only on specific frames when they are attacking.
Ok, thats the point, keep the characterController for movement, jumps, gravity, etc. But for combat, use Sphere or BoxCast, from my character or from the enemies, right? Sorry for beeing so heavy, but this is frustrating for me xD
Answer by Mondragor · Jun 16, 2017 at 08:35 AM
Select the 3D object and in the inspector check generate colliders and then apply the modifications