Skip to content

Commit

Permalink
Fix issue that caused vehicle to rotate while looking around with camera
Browse files Browse the repository at this point in the history
Fix issue that caused vehicle to rotate while looking around with camera
  • Loading branch information
xFutte authored Apr 17, 2023
2 parents e473d97 + cb84e4d commit ba760fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/cl_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ local function CheckInputRotation(cam, zoomvalue)
local new_z = rotation.z + rightAxisX*-1.0*(speed_ud)*(zoomvalue+0.1)
local new_x = math.max(math.min(20.0, rotation.x + rightAxisY*-1.0*(speed_lr)*(zoomvalue+0.1)), -89.5)
SetCamRot(cam, new_x, 0.0, new_z, 2)
SetEntityHeading(PlayerPedId(),new_z)
-- Moves the entities body if they are not in a vehicle (else the whole vehicle will rotate as they look around :P)
if not IsPedSittingInAnyVehicle(PlayerPedId()) then
SetEntityHeading(PlayerPedId(), new_z)
end
end
end

Expand Down

0 comments on commit ba760fe

Please sign in to comment.