Camera Manipulation

How to make player still can move the camera couple angles with their cursor while the camera is still playing moving background like this, well the moving background here work but I also want to add it while tweening the player still can move the camera with their mouse a little bit of angle. Example : Main Menu in Sharkuses BA

local tweenservice = game:GetService("TweenService")

local cam = workspace.Camera
local scenes = workspace.CameraScenes

repeat wait() until cam.CameraSubject ~= nil

cam.CameraType = Enum.CameraType.Scriptable

while true do
	for i, v in pairs(scenes:GetChildren()) do
		cam.CFrame = v["1"].CFrame
		local maxTilt = 10
		local currentTween = tweenservice:Create(cam, TweenInfo.new(10), {CFrame = v["2"].CFrame})
		currentTween:Play()
		wait(10)
	end
end
4 Likes

You’re using while loops for fast loops? You’re joking right?

Use heartbeat instead

Don’t mind about that… It’s just for moving BG bruh, the point of this topic is while still moving background CAMERA, player still able to move a little bit of the camera with their mouse

This youtube video is what you are looking for: [READ DESCRIPTION FOR NEW VERSION] How to Make an ADVANCED MENU | HowToRoblox - YouTube

Yeah you are true, but I want to combine, so my mouse still can do it, but the tween between parts like on my script above still can happen. So is like camera moving automatic by my script + mouse still can move the camera (WHILE TWEENING) like in the video that u sent me. do u know how?

yea just task.spawn() the while loop and for the mouse thingy use runservice

Where should I put I mean the specific place?

local tweenservice = game:GetService("TweenService")

local cam = workspace.Camera
local scenes = workspace.CameraScenes

repeat wait() until cam.CameraSubject ~= nil

cam.CameraType = Enum.CameraType.Scriptable
task.spawn(function()
while true do
	for i, v in pairs(scenes:GetChildren()) do
		cam.CFrame = v["1"].CFrame
		local maxTilt = 10
		local currentTween = tweenservice:Create(cam, TweenInfo.new(10), {CFrame = v["2"].CFrame})
		currentTween:Play()
		wait(10)
	end
end
end)
game:GetService("RunService"):Connect(function()
-- Mouse Code Here
end)

What’s the difference between

game:GetService("RunService"):Connect(function()

end)

And

game:GetService("RunService").RenderStepped:Connect(function()

end)
local tweenservice = game:GetService("TweenService")

local cam = workspace.Camera
local scenes = workspace.CameraScenes
local mouse = game.Players.LocalPlayer:GetMouse()

repeat wait() until cam.CameraSubject ~= nil

cam.CameraType = Enum.CameraType.Scriptable


task.spawn(function()
	while true do
		for i, v in pairs(scenes:GetChildren()) do
			cam.CFrame = v["1"].CFrame
			local currentTween = tweenservice:Create(cam, TweenInfo.new(10), {CFrame = v["2"].CFrame})
			currentTween:Play()
			wait(10)
		end
	end
end)

local originalCFrame = cam.CFrame
local scaleFactor = 1000

game:GetService("RunService"):Connect(function()
	local centreOfScreen = Vector2.new(cam.ViewportSize.X / 2, cam.ViewportSize.Y / 2)

	local mouseDistanceFromCentre = Vector3.new((-mouse.X - centreOfScreen.X) / scaleFactor, (mouse.Y - centreOfScreen.Y) / scaleFactor, 0)


	cam.CFrame = originalCFrame * CFrame.new(originalCFrame.LookVector + mouseDistanceFromCentre)
end)

I make like this but still doesn’t work? Well I made it in a gui, but the tween still work only the mouse no.

Your supposed to have RenderStepped. I’m assuming that it was missed out in accident.

1 Like

or is it also because i have background transparent frame 1,0,1,0 behind? Because yeah I made it for gui

That shouldn’t be an issue. Add renderstepped and see if it works.
Edit: if not, i have a solution.

Also, are you trying to get a “move in and out” effect?

Nooo, it doesn’t work still doesn’t move, like before tween still works but the mouse no.

Well I tested his reference video and works but when i put on my gui it doesn’t work or is it because I use tween service on cam too so is like double? but if it is, there’s couple game that I see it works

Is it affecting because I use workspace.camera not workspace.currentcamera?

TweenService overrides everything that its trying to tween. Also, are you trying to get an effect for the camera like this?

In, out motion?

Nope. Makes no difference. Shouldn’t be a problem

If you know Sharkuses Sandhurst Military Academy, I want like their main menu

The thing is, I don’t. Thats why im trying to ask you what you want, instead of you referencing other games.