Hello,
I’m trying to make a camera where its isometric, sort of like enter the gungeon, or a typical rpg game.
I’ve managed to achieve the camera, but having the player face their mouse often has a lot of issues and i am not sure how to fox them or change how they work.
Ive tried quite a lot of different camera styles and 2 ways of having the character face the mouse and the same issue arises.
^ heres an example of what i mean
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Root = Character:WaitForChild("HumanoidRootPart")
local Mouse = Player:GetMouse()
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
local RootPos, MousePos = Root.Position, Mouse.Hit.Position
Root.CFrame = CFrame.new(RootPos, Vector3.new(MousePos.X, RootPos.Y, MousePos.Z))
end)
^ script which controls humanoid facing mouse pos
local zoom = 166
local FieldOfView = 7
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = game.Workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Custom
local RunService = game:GetService("RunService")
RunService.RenderStepped:Connect(function()
Camera.FieldOfView = FieldOfView
if Character then
if Character:FindFirstChild("HumanoidRootPart") then
game:GetService("SoundService"):SetListener(Enum.ListenerType.ObjectCFrame, Character.HumanoidRootPart)
Camera.CFrame =
CFrame.new(Vector3.new(Character.HumanoidRootPart.Position.X + zoom, Character.HumanoidRootPart.Position.Y + zoom, Character.HumanoidRootPart.Position.Z + zoom), Character.HumanoidRootPart.Position)
end
end
end)
script which controls camera ^
thank you!