- Home /
I just made my animation loop, but now my character walks through all colliders?
Alright, so i just looped my animation, and now the collider doesn't work. My character passes right through my "cubes" that you have to avoid, anyone who might know whats going on? And i HAVE double-checked, i still have my Mesh Collider on my character and my cubes all have a Box Collider that is a tricker. In my controller for my character i did also write a script like this: //When player collides void OnTriggerEnter ( Collider other ) { shouldWalkForward = false; isDead = true; gameObject.renderer.enabled = false;
Help please? Thanks in advance.
Are you saying that collision works if you don't loop your animation? How are you moving your character? Are you using the CharacterController supplied by unity?
For future reference, please provide more details in your questions.
No, it worked before i put on the animation, but dosen't work with or without the animation now. What i did was to import a new character ( the old one was just a cube) and then set everything to the same as the old one, including scripts and options. And i made my own controller.
Answer by hans_vesthardt98 · Dec 16, 2013 at 11:34 AM
Alright, so i got some help from a friend, and it works now. For future reference, what i did was to attack a Rigid Body, but then my character was running around the place when he collided, so i just ticked the Freeze position boxes in the Rigid Body. If you have the same problem, i can give a more in depth explanation, just comment this :)
Answer by fafase · Dec 13, 2013 at 08:06 AM
If a collider is set to be trigger then you will go through. IsTrigger means detecting collision but no resolution.
Unset IsTrigger and you won't get through.
Also, do you really a mesh collider for the player? Do you really need all the details? Often a character controller is enough or if you need more accuracy, boxes around the main part of the body.
I just unset isTrigger on my cubes. Though, i STILL go through my objects. Any idea of what is going on? It has always been working, just not after i added the animation