Thatâs really unusual, there may be a script in that gun that conflicts with the camera, could you try to use this code in a new fresh place?
I see there was something called âweapon systemâ in Output, I bet thatâs causing the problem.
If its an open sourced module, can you post the link to it? So i can check out whats causing the problem.
nope it does not even work on a fresh new place it just top down view againâŚ
but after putting pistol model in, the camera would start changing when moving with your mouse but then the top down view is not working.
The system it self is in replicate storage, dissable it if anything.
maybe i needed to do something more than putting the script in ââStarterPlayerScriptsââ
Nope, thats all you need, i can see that âWeapon Systemâ wasnt desined for top view in mind.
oh wait you need to put it in âStarterCharacterScriptsâ
Yea I updated the code to be actually âTop Viewâ just copy and paste.
Thank you so much now it works just fine
hey uhh i know its solved and itâs old but⌠i put the script in both starter character scripts and starter player scripts, heres the error:
16:12:57.746 ScreenGui is not a valid member of StarterGui "StarterGui" - Client - Top-Down:9
16:12:57.747 Stack Begin - Studio
16:12:57.747 Script 'Workspace.foxnoobkite.Top-Down', Line 9 - Studio - Top-Down:9
16:12:57.747 Stack End
You need a ScreenGui for it to work, without it cant calculate proper mouse movement.
this thing
Create a ScreenGui in StarterGui and thatâs it.
hmmmm im trying to make it a tiny bit vertical like the game vertix.io, I mooded the position value but I canât get it to the middle
-- Made by ThanksRoBama.
-- Explained and polished by Czlopek
local Player = game:GetService("Players").LocalPlayer
local player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local camera = workspace.CurrentCamera
local runService = game:GetService("RunService")
local screenGui = game.StarterGui.ScreenGui
-- here is your template for Vector3 axis (x y z)
local Distance = Vector3.new(0,25,0) -- Distance from player
local Direction = Vector3.new(45,-90,0) -- Direction from which camera will be looking at player
local CameraSensitivity = 20 -- change it if you want that camera to lean further (give it a bigger number)
-- or if want an effect to be more subtle decrease the number. (if you set it as a negative, camera will lean in the opposite direction)
function getMouseScreenPositionCentered()
return Vector2.new(
mouse.X - screenGui.AbsoluteSize.X/2,
mouse.Y - screenGui.AbsoluteSize.Y/2)
end
function pixelToFraction(pixelV2)
--Turns a coordinate in pixels into a coordinate in some fraction of the size of the screen
return pixelV2 / screenGui.AbsoluteSize
end
function onRenderStep()
if player.Character then
local rootPart = player.Character.HumanoidRootPart
local playerposition = player.Character.HumanoidRootPart.Position + Vector3.new(0,0,3) -- sometimes camera will be offset to your character,
-- thats why you need to add few studs to it so it would stay in middle of the screen.
local cameraoffset = Distance + playerposition
local mouseScreenPos = pixelToFraction( getMouseScreenPositionCentered() )
local Axis = Vector3.new(-mouseScreenPos.Y,0,mouseScreenPos.X)
local cameraPos = cameraoffset + Axis * CameraSensitivity
-- depending on what direction you set the camera to be facing remember that you will need to change it accurately to direction of the camera.
-- top down view will have Direction = Vector3.new(0,-1,0) and Axis = Vector3.new(-mouseScreenPos.Y,0,mouseScreenPos.X)
-- side ways Direction = Vector3.new(0,0,-1) Axis = Vector3.new(mouseScreenPos.X,-mouseScreenPos.Y,0)
camera.CFrame = CFrame.new(cameraPos, cameraPos + Direction)
end
end
runService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
hmmm i want it to be in a -45 degree angle, when i changed the -12 to 45, itâs center isnât my player for some reason