How would you make a knife with a backstab mechanic?

So we have a knife. And we have an unused script.

How do I make a backstab script so it autokills the enemy when you stab their back?
and maybe do less damage if its a front stab.

A few hints would be good, and I can’t script right now since there’s an issue with my studio

1 Like
local Dist = (Head.Position - EnemyRootPart.Position).Magnitude|
local Facing = EnemyRootPart.CFrame.LookVector|
local Vector = (Head.Position - EnemyRootPart.Position).Unit|
local Angle = math.acos(Facing:Dot(Vector))*Dist|

you can use that to determine that angle of the attack

1 Like