i have a localscript that is supposed to focus the camera on a brick when it starts, and the focus on the part that is selected(it is stored in an ObjectValue) but it randomly focuses on a part, and will not focus on the selected when the player activates the focus feature. here is the script(i know i should use a function and call it instead of writing the code twice, but i failed to do so)
i get no error messages
workspace.CurrentCamera.CameraSubject=workspace.BuildingBase
script.Parent.MouseButton1Click:connect(function()
workspace.CurrentCamera.CameraSubject=script.Parent.Parent.Parent.Parent.SelectedItem.Value
end)
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.F then
workspace.CurrentCamera.CameraSubject=script.Parent.Parent.Parent.Parent.SelectedItem.Value
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)
any ideas for my problems? thanks

1 comment
Possibly a problem with what your making the CameraSubhect to?