- Home /
Make collision work when animation is playing? c#
Ok, so i have a wooden sword which my player uses, there is a training dummy which i want the player to hit then destroy, i have added a box collision on the dummy and the sword both with their own tags dummy and sword.
now my code works fine once the sword touches the dummy the dummy is destroyed but i only want the dummy to be destroyed when the player attacks it.
at the moment the dummy is destroyed just by walking into it because the sword collides into it.
i want it so that the collision only occurs when the sword is swung by the player.
any advice you can give me? the sword is attached to the players bone and has its own code separate to the player.
i have went through the site sadly cannot find anything that helps so please if you can tell me how to do it that would be great.
Before you evaluate whether or not to destroy the "dummy", can't you simply check whether you are attacking?
You haven't given much technical detail so a much more detailed answer is not really possible.