Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

mouse.Hit.LookVector is inaccurate, any help?

Hello all.

I have been trying to make a aimable throwable knife and this is all I got.

local new = game.ServerStorage.Knife:Clone()
new.Parent = plr.Character
new.Holder.CFrame = torso.CFrame
local veil = Instance.new("BodyVelocity", new.Holder)
veil.P = math.huge
veil.Velocity = mouse.hit.LookVector * 50

However when I test it, it seems to be inaccurate. Any solution?

1 answer

local knife = script.parent
local Handle = knife.Handle
knife.CFrame = CFrame.new(Handle.Position ,mouse.hit.p)local veil = Instance.new("BodyVelocity", new.Holder)
veil.P = math.huge
veil.Velocity = knife.CFrame.LookVector * 50

3 comments

0

it should work but i didn't check it

0

Thank you asd, It worked but it didn't rotate to the correct way.

0

@MineBlow111 if it doesn't rotate properly just re rotate it xd

This discussion is preserved as it was. New answers, comments, and votes are closed.