I'm working on a game prototype where I am trying to create three animated sprites: the player, the enemy and a weapon (an animated sprite that is the child of the player). The enemy is a gameobject of sprites with rigidbodies that will "explode" out of place (ideally using physics) when I kill the enemy.
Right now I am currently having a bear of a time getting all of that to work. My current setup is:
The weapon is an animated sprite that has "create collider" checked. Additionally the sprites making up the sword swing have trimmed box colliders. However whenever the animation plays and the sword swings it is not triggering any OnCollision* or OnTrigger* events.
My Player is a Unity standard Character Controller, the animated sprite is set to not create a collider. If I make my enemy a trigger then my character controller will fire events, but the sword animation will not.
I got frustrated and started arbitrarily adding physics (great debugging, I know) and I was able to get my sword swing to register collision when I:
* Made my capsule regular collision.
* Made my 3 enemy "pieces" all have collision.
When I do this the collision all sort of slams together and my enemy goes flying, but when it lands I can "attack" it with my sword swing and the collision registers. However, the invisible capsule collision of the initial positioning is lingering.
I'm probably rambling a bit too much and showing off how little I know about colliders and Unity, but I'm not sure what I'm doing wrong. Any advice would be appreciated!