Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

help with camera manipulation?

Asked by
lukeb50 631 Moderation Voter
8 years ago

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

0
Possibly a problem with what your making the CameraSubhect to? PreciseLogic 271 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

0
i always check the wiki and do extensive debugging before posting here. there is nothing in there that helps lukeb50 631 — 8y
Ad

Answer this question