i made script which locks x,z rotation and keeps y rotation but, it just makes character fly
like this:
code:
local camera = game.Workspace.CurrentCamera
local character = game.Players.LocalPlayer.Character
local humanoid : Humanoid = character:WaitForChild("Humanoid")
local rootPart = humanoid.RootPart
local RotationChangedEvent = Instance.new("BindableEvent")
local RCEvent : RBXScriptSignal = RotationChangedEvent.Event
local LastRotation = rootPart.Rotation
function OnEvent()
rootPart.Rotation = Vector3.new(0,rootPart.Rotation.Y,0)
end
function Update()
local CurrentRotation = rootPart.Rotation
if LastRotation ~= CurrentRotation then
RotationChangedEvent:Fire()
end
end
RCEvent:Connect(OnEvent)
game:GetService("RunService").Heartbeat:Connect(Update)