Hello, recently i was working on a hook that makes the player go towards mouse, and it worked pretty well but when i tried to make the player points towards mouse while moves towards it the player gets stuck because i’m using CFrame for making the player points towards it and it makes the player get stuck.
local Connection
RemoteEvent.OnServerEvent:Connect( function(Client, MouseHitp, RootPart)
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Parent = RootPart
BodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
local VelocityMultiplier = 50
Connection = RunService.Stepped:Connect( function()
-- Making the root part point to the mouse makes it get stuck because it set its position to its position but i don't know another way to make the root part point to the mouse
BodyVelocity.Velocity = CFrame.new(RootPart.Position, MouseHitp).LookVector * VelocityMultiplier
RootPart.CFrame = CFrame.new(RootPart.Position, MouseHitp)
end)
Is there another way to make a part point to a position without getting stuck?
I would suggest using a bodymover (such as a bodygyro) instead of CFrame lookat to poin towards the part. Since you are manipulating the positio through a bodymover, why not the rotation too? (Ignore the AngularRotation stuff on the webpage)