Detecting what my sword hits


I’m trying to make a third person controlled game. My player character has a child game object sword. My plan was to animate my player, and have a collider on my sword detecting what it hits.

Now I’ve learned that childrens colliders can’t detect collisions…

Is there any way to go round this, or any good method for finding out what my sword passes by?

Any help much appreciated!

You could use a raycast from the player that finds whatever is in front of them when they swing the sword.

You could use the sword’s collider though, just make a script that is placed on the sword object that handles the collision, and sends the information of the collision to the main player script, or have that sword script handle all the collision stuff on its own.