I've 2 characters, they both have characterControllers and Capsule collider(with same radius and height - to fit the characterController collider style), I want to check if there's a collision between them, and if there's so the second character will play an animation too.(which is attack animation)
On my main hero :
function OnControllerColliderHit(hit : ControllerColliderHit)
On the monster :
function OnCollisionEnter(hit : Collision)
if(hit.collider.tag == "Player")
Mike, instead of editing lol, answer me! :<
please provide more information. does it have an error. does unity call it or not? ...
Now, I put function OnControllerColliderHit(hit : ControllerColliderHit)
and it does collide, but only when it moves.. I don't want it to collide just when it moves, I want a fast collision when there's a collision. which means - when the player hits the enemy when it's on move so they both will use animation.
There are almost identacle threads. Search before you post!!!
Which one are you about? Also, almost isn't enough.
Answer by Ashkan_gc
Jun 24, 2010 at 02:10 PM
it seems that the problem is in another place like the name of the collider or the tag of the player. to make sure that the function is called use print and print the name of other collider and ...
in less than a few month we will have a debugger wich will solve all problems like this easier. :)
be aware that names are case sensitive.
Yeah I know, I'll put some debugs now, and what do u mean debuggers which will solve all problems? O_O
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
Stop animation when character controller hits walls
Collisions with an animated character
Character Controller surpassing Collider with iTween
Pixel Perfection collision on 3d animated object
How to have other (any) Objects smoothly push a Character Controller?