Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

help with camera manipulation?

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

0

Possibly a problem with what your making the CameraSubhect to?

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.