Yes, I’m aware CFrame exists, and there’s many posts like this, but none of them use the same thing that I do and they don’t help me. I’m using TweenService to move the knife (which is the part).
local knife = script.Knife:Clone()
local mouse = args[1]
knife.Parent = game.Workspace
knife.Position = player.Character.HumanoidRootPart.Position
--knife.CFrame = CFrame.new(knife.Position, mouse.Position)
--knife.CFrame = CFrame.lookAt(knife.Position, mouse.Position)
local destroyed = false
local movement = TS:Create(knife, TweenInfo.new((knife.Position - mouse.Position).Magnitude / 60), {Position = mouse.Position})
if game.Workspace:FindFirstChild("TSEffect") == nil then
movement:Play()
knife.CFrame = CFrame.new(knife.Position, mouse.Position)
print((knife.Position - mouse.Position).Magnitude / 60)
knife.Touched:Connect(function(hit)
if hit.Parent.Name ~= player.Name then
if hit.Parent:FindFirstChild("Humanoid") and destroyed == false then
hit.Parent.Humanoid.Health -= 5
knife.Sound:Play()
end
destroyed = true
task.wait(0.2)
knife:Destroy()
end
end)
else
movement:Pause()
end
I dont understand. The fastest way to make a cframe face a vector3 is by using CFrame.lookAt. If the rotation is wrong then you can adjust using CFrame.Angles
I saw it was commented. But i was talking about when you used it. Did you even use it?
Ye I know but I’m recommending him to use Velocity because TweenService might result in unrealistic movement (the time going to the destination is always the same)