Code:
while true do wait() local ray = Ray.new(char.HumanoidRootPart.CFrame.p, (mouse.p - char.Head.CFrame.p).Unit) trident.CFrame = char.Head.CFrame*CFrame.new(0,2.5,0) trident.CFrame = trident.CFrame*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)) end
In these lines of code I tried using CFrame.Angles to make the pointy part of my spear always face where my mouse is pointing. but the
trident.CFrame = trident.CFrame*CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
part is where it got tricky. I used ray.Direction but it won't accept it because it needs a number value, not a Vector3 value. How do I make it so that it would constantly face my mouse?
ok its very easy if you know the trick if you use something like this
trident.CFrame = CFrame.new(trident.CFrame.p , mouse.p)
but this only works if the pointy part is in the front