I want to achieve the blood to spray in the direction of the cut, so getting the direction of the swing or cut
I suck at math and couldnt find a solution so im here
i tried using the blades velocity
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
// in local script, here i send the origin(otherPart.Position), and direction(blade.AssemblyLinearVelocity) of the cut
event:FireServer("Damage", false, otherPart, blade.AssemblyLinearVelocity, otherPart.Position)
// in effects script
Engine:EmitAmount(position, direction, 12)
What i would do is when you first swing you sword, Grab position at which the blade is at when the animation is raising it, and when the sword hits the NPC take the hit position and use cframe.lookat to get a direction between the two.
--# Blade positions
local raisedPosition = Vector3.new() --> The position of the blade when the character raises the sword to swing.
local hitPosition = Vector3.new() --> The position at which the blade hit the NPC.
--# Final direction
local bloodDirection = CFrame.lookAt(raisedPosition, hitPosition).LookVector --> Direction that the blade is moving.