knife weapon?


I setup some bricks so that I can use a cylinder as a make shift knife to attack an enemy cube. It doesn’t work as is, if I apply a material so just a colour material it then will remove the enemy cube from sight.

What is the solution to making it work like knife to hit. Otherwise it is just a object touching another, there is no challenge.


You have 2 options:

  1. Make the knife object that you are animating have ‘Static’ Physics. Not the best idea because it can cause glitching.
  2. while playing the knife animation add a ray shooting forward to check if it hits anything and if so, end the object it hits.
    Otherwise you can spawn in an invisible, ghost, dynamic cube at the knife, and have the AI check for damage upon collision with this.

The first was already like that, as for the second.

How do you mean by have a ray shoot?

As for the invisble cube, that would be parented to the knife?

I tried parenting or joining the weapon to a hand, but that ends up in a problem of either it not working or the colour change of the weapon once joined.

Parenting as an object isn’t good or vertex.

I joined the weapon to the hand, and flip faces. I think that should probably be okay.