Hello, recently i was making a hook that makes the character go towards the mouse with a body velocity, but it’s pretty hard to use it because i can’t go right or left, is there a way to do this?
I don’t need a entire script just a math function or something like that.
I searched in internet and devforum and i found a way but it keeps turning left (or right) and doesn’t go towards the mouse, i need the character to turn left just a bit and keep going toward the mouse
You can’t make a CFrame.LookVector to left or right, it can only go to the front direction. Instead, you may want to rotate the character to look at the mouse, then you only use LookVector to go towards the mouse.
Hello, (sorry for the late answer) it worked pretty well but the player go left while going backwards, i want it to go left (or right) while going forwards, how can i do this? I tried placing the math.pi/2 in the other 2 values but didn’t worked
function Turn(
mycframe, -- current cframe
V3 -- orientation offset
-- Example: if u want to turn left, the V3 should be (0,90,0)
)
return mycframe:ToWorldSpace(
CFrame.Angles(
math.rad(V3.X)
,
math.rad(V3.Y)
,
math.rad(V3.Z)
)
)
end
MyPart = workspace.Part
MyPart.CFrame = Turn(MyPart.CFrame,Vector3.new(0,30,0)) --Turning the part 30 degrees to the left