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
All the information you will need for Camera Manipulation is on the Wiki. I linked it for you below.
ROBLOX Wiki: http://wiki.roblox.com/index.php?title=Camera_manipulation