#idk what im doing wrong with collider
1 messages · Page 1 of 1 (latest)
so i want the player's character to lose hp when the player's tag is collided with the enemy's enemy_sword tag
i tried putting on_trigger on both of them aswell
but still remain not workin
so the "ok it works" is not logging?
it jsut a debug that there is a collision occuring
which there isnt
so it the collision bit that is not working
not the tag
which game object is this script attached to?
this capsule
it happen when it collied with the floor
but not when the sword hit the charatcer
also i use animation on the sword
does that affect it?
and how do you move the sword?
so the enemy move toward the player
and perform an animation
which is the sword swining
swinging
im pretty sure that just moving the transform position will NOT produce collision events
ok
let me check if the collide moves
while the animation is preforming
it might be that
yeah good idea
opk
i jsut check
i dont see no collide aroudn nt
might be that
maybe i need to include the collider in the animation
double check the script handling the collision is also enabled in the inspector during play mode
you have colliders on both and the rigidbody is on the player so collision events should be firing
I think its fairly common to just enable a collider at some point in the animation and use that to detect if it hit the player, saves you from having to animate the collider
Unity has the ability to use Animation events to call functions at certain parts of the animation which can be useful for enabling a collider midswing etc
ok
ill check those our
the animation does incldue the collider
so it may be the scripting
ok
double check your tag, make sure it doesnt have a piece of white space at the end or something strange, honestly its not clear and evident to me why its not working
you didnt by change mess with the physics matrix or somehow set these things to ignore each other?
i dont think i tocuhed those
ok it works now
cool what was it
but that because it made the enemy's whole model
the tag
but i only want it to occus when the sword hits it
maybe cause my sowrd collider is too small
prob?
ok i made it bigger
but it still doesnt work
it prob is the animation
ok i think i acc know why no
i removed the animation
it still doesnt work
it prob the collider box itself
that doesnt work
which i dont even know why
makes no sense
wait is it because the whole thing is one colliders?
cause i made it into 1 whole object
let me try split it up
stil the same
well watever
yeah its tough to do it over text if you want to try and hop on a live call I can get a better understanding as to what is going on