#please help

1 messages · Page 1 of 1 (latest)

jolly stream
static narwhal
#

Be more specific about what you are talking about

#

show which object(s) have which components

#

and explain the hierarchy

#

etc..

#

pictures would help

jolly stream
#

Theres an object of the sword the player is holding

#

it has a rigidbody and a trigger collider

#

The main player object

#

(the parent to the sword)

#

has the script to check if collide, and character controller

#

there is also a child object with a trigger box collider

static narwhal
#

so here's the thing. Rigidbodies serve as sort of "delimiters" for physics objects and physics callbacks

#

The object that has the Rigidbody "owns" all of the colliders underneath it, unless there's another Rigidbody in there, in which case that body owns all the colliders underneath it

jolly stream
#

okay

static narwhal
#

Scripts with collision callback functions will get called on:

  • The exact object with the collider
    or
  • The object with the Rigidbody that owns the collider
#

nowhere else

jolly stream
#

could i add a kinematic rigidbody to the parent object without having it cancel the character controller

static narwhal
#

it won't "cancel" anything but it also won't let you own the sword's collider, since the sword's rigidbody owns that collider

#

what are you trying to do?

#

Maybe just have the sword notify a script on the parent object about the collision

jolly stream
#

i just want the parent to collide

#

not the sword

static narwhal
#

just have the sword do something like GetComponentInParent<Player>().RegisterHit(); when it collides with something