Camera Manipulation Help

  1. What do you want to achieve? Keep it simple and clear!

I want my Camera Manipulation to work when a ClickDetector is Clicked. Every Model has Camera Model on it

image

When I click the click detector, I want the script to activate the Camera Manipulation and determine which camera will provide the cframe position to the camera manipulation. Because each model in the Folder contains a Part named “Cam,” which is the camera cframe, I don’t want GetDescendants to choose a random camera and manipulate a random position from the other model.

image

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried searching a same topic to mine but none is helpful

Sorry if my explanation is bad because its hard to explain

Have you written out a script that I can see?

(Sorry I have to go now I’ll be back in a couple of hours)

Local Script:

local camera = workspace.CurrentCamera
local looking = false
 --> put the CFrame of where you want the camera to end up here
local tweentime = 1
local debouncetime = 0.5
local active = false



game.Workspace.CanariaSci.main2.OnClientEvent:Connect(function(plr, btn)
	local endCFrame = CFrame.new(btn.Parent.Parent.Cam.Position)
	print("delivered")
	if active then return end active = true
	looking = not looking
	if looking then
		camera.CameraType = Enum.CameraType.Scriptable
		game.TweenService:Create(camera, TweenInfo.new(tweentime, Enum.EasingStyle.Sine, Enum.EasingDirection.Out,0,false,0), {CFrame = endCFrame}):Play()
		wait(tweentime+debouncetime)
	else
		camera.CameraType = Enum.CameraType.Custom
		wait(debouncetime)
	end
	active = false
end)

Server:

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	script.Parent.Parent.Parent.Parent.Parent.main2:FireClient(plr, script.Parent)
	print("Clicked")
end)

Here you go.

Is there something wrong in my script @Dev_Lightz ?

I think, if this makes sense, you can (maybe) only change the camera in/from the StarterGui. And it might not work because it’s in the ServerScriptService (I think it’s there). I don’t always do Camera Manipulation, and when I do, I do it from the StarterGui.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.