#how do i fix this

26 messages · Page 1 of 1 (latest)

zinc shuttle
shadow sinew
zinc shuttle
zealous wharf
zinc shuttle
#
local char = script.Parent
local hrp = char:WaitForChild("HumanoidRootPart")
local cam = game.Workspace.CurrentCamera
local uis = game:GetService("UserInputService")


cam.CameraType = Enum.CameraType.Scriptable

local function updatecam()
    uis.MouseBehavior =  Enum.MouseBehavior.LockCenter
    cam.CFrame = hrp.CFrame:ToWorldSpace(CFrame.new(5,2,8))
end

game["Run Service"].RenderStepped:Connect(updatecam)
#

ohhhhh

zealous wharf
#

everything is working fine

zinc shuttle
#

how do i not make the person go spinny tho??

#

like when i go left and right?

#

also how do i find the mouse

#

stuff

#

if its blocks

#

block

zinc shuttle
#

@zealous wharf is there a mouse input that i can use to move the camera?

zealous wharf
#

idk

#

but there is no input for this ig

zinc shuttle
# zealous wharf but there is no input for this ig
-- Services
local uis = game:GetService("UserInputService")
local rs = game:GetService("RunService")
local context = game:GetService("ContextActionService")

-- Player & Character
local plr = game:GetService("Players").LocalPlayer

-- Other
local Camera = game:GetService("Workspace").CurrentCamera
local mouse = plr:GetMouse()
local cameraDB = false
local zoomDB = false

-- Values

local xAngle = 0
local yAngle = 0
local cameraPos = Vector3.new(2,0,8.5)


-- CAMERA SETTING --

wait(0.01)
Camera.CameraType = Enum.CameraType.Scriptable

-- FUNCTIONS --

context:BindAction("CameraMovement", function(_,_,input)
    xAngle = xAngle - input.Delta.x*0.4
    yAngle = math.clamp(yAngle - input.Delta.y*0.4,-80,80)
end, false, Enum.UserInputType.MouseMovement)

rs.RenderStepped:Connect(function()
    local c = plr.Character or plr.CharacterAdded:Wait()
    local rootPart = c:FindFirstChild("HumanoidRootPart")
    
    if c and rootPart then
        local startCFrame = CFrame.new((rootPart.CFrame.p + Vector3.new(0,2,0)))*CFrame.Angles(0, math.rad(xAngle), 0)*CFrame.Angles(math.rad(yAngle), 0, 0)
        
        local cameraCFrame = startCFrame + startCFrame:VectorToWorldSpace(Vector3.new(cameraPos.X,cameraPos.Y,cameraPos.Z))
        local cameraFocus = startCFrame + startCFrame:VectorToWorldSpace(Vector3.new(cameraPos.X,cameraPos.Y,-50000))
        
        Camera.CFrame = CFrame.new(cameraCFrame.p,cameraFocus.p)
    end
end)
#

is there one in here?

zealous wharf
#

math.script 💀

#

maybe this

#

but i don't understand this math formulas

zinc shuttle
#

tf is input.Delta?

#

is it how fast the mouse is moving

#

or how much it moved

zealous wharf
#

i'm not in math bruh 😭

shadow sinew