I am working on making an overhead camera for my game.
I tried this a while ago and had no issues, but however just today i tried it and i cant seem to be able to "control" my player's character. Pressing "Arrow Keys" or "WASD" do nothing.
The script itself was pretty easy, but i am puzzled on this part. I tried zooming the camera in, and out, and it still wont let my character move. The only way to actually make it work is if i change the X and Z coordinates as well when editing the camera.
Script (you can see how i only edited the Y coordinates):
local runService = game:GetService('RunService') local function onRenderStep() end local offset = Vector3.new(0,40,0) local player = game.Players.LocalPlayer local camera = game.Workspace.CurrentCamera local runService = game:GetService('RunService') local function onRenderStep() local playerPosition = player.Character.Head.Position local cameraPosition = playerPosition + offset camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition) end runService:BindToRenderStep( 'Camera', Enum.RenderPriority.Camera.Value, onRenderStep)
If you know why this is then please help :P
Thanks!
I'm guessing you put this in StarterPlayerScripts, in which case I'm also guessing, did you you name the script "CameraScript" by any chance?
If you put a script called CameraScript in StarterPlayerScripts, ROBLOX will over-write the default camera/movement script with it. This can be super useful in some instances, as you don't have to manually disable ROBLOX's default scripts, but in your case it's problematic as it's disabled your movement when you didn't want it to. I'm honestly not sure why the Camera script and Movement script are linked, but they seem to be.
If I'm correct and it is titled CameraScript, simply rename the script to something else, and it should work. If not, get back to me and I'll take another crack at it. :)