Hey devs!
So to be honest I totally suck at scripting. I can do only the very basics. I wanted to make the camera movements and walking similar to popular Roblox game Doors. Because as I said I can’t script properly I stoled script from a tutorial on YouTube. Everything in the script works perfectly, but the mouse cursor disappears which isn’t great for my game.
I wanted to ask if anyone could help me with this one. What part of the script I should delete or which add.
I already tried reading the script by my self, but was not able to find the part which may cause it.
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local Turn = 0
local Lerp = function(a, b, t)
return a + (b - a) * t
end;
RunService:BindToRenderStep("CameraSway", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
local MouseDelta = UserInputService:GetMouseDelta()
Turn = Lerp(Turn, math.clamp(MouseDelta.X, -7.5, 7.5), (7 * deltaTime))
Camera.CFrame = Camera.CFrame * CFrame.Angles(0, 0, math.rad(Turn))
end)
(There were 2 scripts in the tutorial, but I think this one is more likely to cause it.)
I will be really thankful for any comments.
(I also added video so you can see what I exactly mean. The video is uploaded the Google Drive because its too big.)
The video: Untitled.mov - Google Drive
Thanks in advance!
-jeziskrista