So, im making a flying mechanic similar to Marvel: New Journey’s. Everything is fine BUT i cant seem to make the Body Gyro turn to the player’s direction when moving
I tried to implement the momentum code to my fly script and it rotates based on my move direction, yes. But it doesnt rotate based on camera’s cframe.
here is the momentum code:
Momentum = (hrp.Velocity + (hrp.CFrame.lookVector * 50))
v3.CFrame = CFrame.new(Camera.CFrame.LookVector, Momentum) -- this was CFrame.new(Vector3.new(0,0,0), Momentum) but i changed it thinking it will follow along with the camera but it didnt work.
--incase you need the velocity mover function, here it is:
local function u2()
if Humanoid.MoveDirection == Vector3.new(0, 0, 0) then
return Humanoid.MoveDirection
end
local v12 = (Camera.CFrame * CFrame.new((CFrame.new(Camera.CFrame.p, Camera.CFrame.p + Vector3.new(Camera.CFrame.lookVector.x, 0, Camera.CFrame.lookVector.z)):VectorToObjectSpace(Humanoid.MoveDirection)))).p - Camera.CFrame.p;
if v12 == Vector3.new() then
return v12
end
return v12.unit
end
I played it and yes, The movement of the player is what i want to achieve. I tested mine again and it seems similar to the flying system in marvel games. Thanks for the help!