#idk what im doing wrong with collider

1 messages · Page 1 of 1 (latest)

jaunty mason
#

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

fluid leaf
#

so the "ok it works" is not logging?

jaunty mason
#

which there isnt

#

so it the collision bit that is not working

#

not the tag

fluid leaf
#

which game object is this script attached to?

jaunty mason
#

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?

fluid leaf
#

and how do you move the sword?

jaunty mason
#

and perform an animation

#

which is the sword swining

#

swinging

fluid leaf
#

ok but still how does that move it

#

by updating its transform?

jaunty mason
#

rotataion and transform

#

yea

fluid leaf
#

im pretty sure that just moving the transform position will NOT produce collision events

jaunty mason
#

let me check if the collide moves

#

while the animation is preforming

#

it might be that

fluid leaf
#

yeah good idea

jaunty mason
#

opk

#

i jsut check

#

i dont see no collide aroudn nt

#

might be that

#

maybe i need to include the collider in the animation

fluid leaf
#

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

jaunty mason
#

ok

#

ill check those our

#

the animation does incldue the collider

#

so it may be the scripting

fluid leaf
#

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?

jaunty mason
#

ok it works now

fluid leaf
#

cool what was it

jaunty mason
#

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

fluid leaf
#

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