#[SOLVED] why does this break the clients camera

30 messages · Page 1 of 1 (latest)

clear zephyr
#
        local towerbutton = towersGui.Template:Clone()
        local towertemplate = tower:Clone()
        towertemplate.Parent = towerbutton.Icon.WorldModel
        local portcamera = Instance.new("Camera")
        towerbutton.Icon.CurrentCamera = camera
        camera.CFrame = CFrame.new(towertemplate.HumanoidRootPart.Position, towertemplate.HumanoidRootPart.CFrame.LookVector * 2, towertemplate.HumanoidRootPart.Position)
        camera.CFrame = towertemplate.HumanoidRootPart.CFrame * CFrame.Angles(math.rad(30), math.rad(-200), 0) * CFrame.new(0,0,2)
        camera.Parent = towerbutton.Icon
        towerbutton.Price.Text = tower.Stats.Price.Value.. "$"
        towerbutton.Parent = towersGui```
#

the viewport works but the clients camera gets stuck

#

still waiting

plucky cove
#

I'll take a look at this in a sec :3

clear zephyr
#

ok

plucky cove
#

Ok ig while I wait for that guy I can take a look

plucky cove
clear zephyr
#

ye

#

it works but the clients actual camera breaks too

plucky cove
#

What are you trying to make?

#

weird ss but is this what you;re tryna make?

clear zephyr
#

similar

plucky cove
#

You set the wrong camera

clear zephyr
#

what should i do then

plucky cove
#

Are you a new scripter?

clear zephyr
#

nope

#

i think im intermediate

plucky cove
#

Well 2 things

#

Parent the camera to the viewport

#

And second is to set the viewports current camera to portcamera

clear zephyr
#

"Icon" is an viewport

plucky cove
#

Ik

#
local portCamera = Instance.new("Camera")
portCamera.Name = "PortCamera"
portCamera.Parent = towerbutton.Icon

towerbutton.Icon.CurrentCamera = portCamera
clear zephyr
#

still the same

plucky cove
#

Let me see ur code

clear zephyr
#

im dumb

#

i set the cameras cframe instead of portcameras

#

i solved it ty