local RunService = game:GetService("RunService") local players = game:GetService("Players") local CameraPart = workspace:WaitForChild("CameraPart") local CurrentCamera = workspace.CurrentCamera local LocalPlayer = players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local GUI = script.Parent local PlayButton = GUI.PlayButton local MOVE_SPEED = 150 local function UpdateCamera() local Center = CameraPart.CFrame local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0) CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0) end local Connection = RunService.RenderStepped:Connect(UpdateCamera) PlayButton.Activated:Connect(function() Connection:Disconnect()
Here is the full script local RunService = game:GetService("RunService") local players = game:GetService("Players") local CameraPart = workspace:WaitForChild("CameraPart") local CurrentCamera = workspace.CurrentCamera local LocalPlayer = players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local GUI = script.Parent local PlayButton = GUI.PlayButton local MOVE_SPEED = 150 local function UpdateCamera() local Center = CameraPart.CFrame local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0) CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0) end local Connection = RunService.RenderStepped:Connect(UpdateCamera) PlayButton.Activated:Connect(function() Connection:Disconnect()
hii! im planning on doing a horor game, and i dont really know lua code language, only thing i know to do are proximity prompt dialogues and theres so much to do on a horror ame, would you like to help me? do i need to pay for it?
brooo, :c it doesnt work. I literally copied the script from the comments, did every step u did. I dont have the camera plus the play button aint working. I spent 1 hour to decorate my main menu place and nothing works ;c Edit : Nvm It worked!!! looks awesome tysm bro!
FULL SCRIPT local RunService = game:GetService("RunService") local players = game:GetService("Players") local CameraPart = workspace:WaitForChild("CameraPart") local CurrentCamera = workspace.CurrentCamera local LocalPlayer = players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local GUI = script.Parent local PlayButton = GUI.PlayButton local MOVE_SPEED = 150 local function UpdateCamera() local Center = CameraPart.CFrame local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0) CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0) end local Connection = RunService.RenderStepped:Connect(UpdateCamera) PlayButton.Activated:Connect(function() Connection:Disconnect()
Your camera moves too much to right Fixed Code local RunService = game:GetService("RunService") local Players = game:GetService("Players") local CameraPart = game.Workspace:WaitForChild("CameraModel"):WaitForChild("CameraPart") local CurrentCamera = game.Workspace.CurrentCamera local LocalPlayer = Players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local GUI = script.Parent local MOVE_SPEED = 25 local function UpdateCamera() local Center = CameraPart.CFrame local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0) CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.X/2)/MOVE_SPEED), 0) end local Connection = RunService.RenderStepped:Connect(UpdateCamera)
Local RunService = game:GetService("RunService") local players = game:GetService("Players") local CameraPart = workspace:WaitForChild("CameraPart") local CurrentCamera = workspace.CurrentCamera local LocalPlayer = players.LocalPlayer local Mouse = LocalPlayer:GetMouse() local GUI = script.Parent local PlayButton = GUI.PlayButton local MOVE_SPEED = 150 local function UpdateCamera() local Center = CameraPart.CFrame local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0) CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0) end local Connection = RunService.RenderStepped:Connect(UpdateCamera) PlayButton.Activated:Connect(function() Connection:Disconnect()
WOW i subbed and liked! This really helped me!
Tysm! 🥰
@@deciq_z can u help me with this it wont work for me idk why🤨🤨🤔
local RunService = game:GetService("RunService")
local players = game:GetService("Players")
local CameraPart = workspace:WaitForChild("CameraPart")
local CurrentCamera = workspace.CurrentCamera
local LocalPlayer = players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local GUI = script.Parent
local PlayButton = GUI.PlayButton
local MOVE_SPEED = 150
local function UpdateCamera()
local Center = CameraPart.CFrame
local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0)
CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0)
end
local Connection = RunService.RenderStepped:Connect(UpdateCamera)
PlayButton.Activated:Connect(function()
Connection:Disconnect()
GUI:Destroy()
end)
Gui destroy
Thank You
Thank you a ton be trying to make something for my game like this forever
Here is the full script
local RunService = game:GetService("RunService")
local players = game:GetService("Players")
local CameraPart = workspace:WaitForChild("CameraPart")
local CurrentCamera = workspace.CurrentCamera
local LocalPlayer = players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local GUI = script.Parent
local PlayButton = GUI.PlayButton
local MOVE_SPEED = 150
local function UpdateCamera()
local Center = CameraPart.CFrame
local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0)
CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0)
end
local Connection = RunService.RenderStepped:Connect(UpdateCamera)
PlayButton.Activated:Connect(function()
Connection:Disconnect()
GUI:Destroy()
end)
lifesaver.
for real@@sour_axolotl
Thanks.
I keep getting the " Infinite yield possible on 'Workspace:WaitForChild("CameraPart")' " error
You have to name the part to CameraPart
It's not workinggg helppp I've been working for hourssss😭😭😭
Why'd you create a vector and not use it?
great video thanks
i did all scripts and not working
why wouldn't you just copy all script?
and put in the description?
i wonder whos that red hat guy anyway?????
how do i put sound
Dev_Deciqz I need help. when I press the start button the camera is bugged
Please Lmk how to fix!!
it wont work i copied every step I named everything the same as you named it, How to fix pls?
is not working😭😭😭😭😭😭 how do u fix that?
Not working
Bro why did i spawn on R15? still, thanks, your script worked, im making a game on R6 not R15
Game settings > Avatar
why does my charatcer spawn in first
Thank you alot
what musikc
hii! im planning on doing a horor game, and i dont really know lua code language, only thing i know to do are proximity prompt dialogues and theres so much to do on a horror ame, would you like to help me? do i need to pay for it?
How did ur roblox horror game go?
idk what i did wrong, followed every step but when i clicked play it didnt work (i spent an _hour_ doing the script)
Im so sorry about it. What is the error you are getting?
@@deciq_z idek im not rlly getting an error it just didnt work
@@deciq_z wait nvm i think i fount jt lmao
im getting the sam how did u fix@@ella_yep
@@ella_yep same, with every tutorial i do, none of the scripts work for me
Do ur script so that when ur in the gui u cant move , ur invicible and invisible
😄Thank You
brooo, :c it doesnt work. I literally copied the script from the comments, did every step u did. I dont have the camera plus the play button aint working. I spent 1 hour to decorate my main menu place and nothing works ;c
Edit : Nvm It worked!!! looks awesome tysm bro!
How do u fixed it?
hey how did you get it to work please?
how did you fix it?!?!?!?!?
yo bro how did you fix it?
2:09 i do not know how.. 💀
bro this sucks i followed all instructions and it didnt work
FULL SCRIPT
local RunService = game:GetService("RunService")
local players = game:GetService("Players")
local CameraPart = workspace:WaitForChild("CameraPart")
local CurrentCamera = workspace.CurrentCamera
local LocalPlayer = players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local GUI = script.Parent
local PlayButton = GUI.PlayButton
local MOVE_SPEED = 150
local function UpdateCamera()
local Center = CameraPart.CFrame
local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0)
CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0)
end
local Connection = RunService.RenderStepped:Connect(UpdateCamera)
PlayButton.Activated:Connect(function()
Connection:Disconnect()
GUI:Destroy()
end)
Your camera moves too much to right
Fixed Code
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local CameraPart = game.Workspace:WaitForChild("CameraModel"):WaitForChild("CameraPart")
local CurrentCamera = game.Workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local GUI = script.Parent
local MOVE_SPEED = 25
local function UpdateCamera()
local Center = CameraPart.CFrame
local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0)
CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.X/2)/MOVE_SPEED), 0)
end
local Connection = RunService.RenderStepped:Connect(UpdateCamera)
doesnt work for me do i put the Camera under StarterGUI?
Nevermind thank you so much!
actually it doesnt work.
Local RunService = game:GetService("RunService")
local players = game:GetService("Players")
local CameraPart = workspace:WaitForChild("CameraPart")
local CurrentCamera = workspace.CurrentCamera
local LocalPlayer = players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local GUI = script.Parent
local PlayButton = GUI.PlayButton
local MOVE_SPEED = 150
local function UpdateCamera()
local Center = CameraPart.CFrame
local MoveVector = Vector3.new((Mouse.X - Center.X)/MOVE_SPEED, (Mouse.Y - Center.Y)/MOVE_SPEED, 0)
CurrentCamera.CFrame = CameraPart.CFrame * CFrame.Angles(math.rad(-(Mouse.Y - Center.Y)/MOVE_SPEED), math.rad(-(Mouse.X - Center.Y)/MOVE_SPEED), 0)
end
local Connection = RunService.RenderStepped:Connect(UpdateCamera)
PlayButton.Activated:Connect(function()
Connection:Disconnect()
GUI:Destroy()
end)