Camera Manipulation

So is like combination of moving background but player still can move the camera a little bit even if the previous tween (moving background) still playing

Or is it okay to record video of this game just couple part of it and show, so u can really see what I want to make?

Iā€™m too tired to give a solution, but try looking into lerping between two cframes and adding the mouse rotation/

https://gyazo.com/2726534a62b9c6362b39ac8dec10dd2a

Is like this, u can see is moving but when moving, player can still control the camera a little bit of with mouse

I probably understand you. I think you want the tween not to override the cframe completely, it should only offset it so the player can move the camera too.
Well thatā€™s probably impossible with tween service, you should use some CFrame math, and here is a solution I made myself for a topic:
How would I offset the camera with rotation? - Help and Feedback / Scripting Support - DevForum | Roblox

How to apply it like a tween? If I see you change the rotation not the position, If Iā€™m not mistaken? correct me if iā€™m wrong i donā€™t really understand

1 Like

Well is like combination of my script with this video

Because my script tweening like moving background and This video

itā€™s a bit hard, since you need a great understanding of cframe math and other stuff, However let me give you some resources to help you out
First of all, my video can give you a basic understanding of how cframes work here:

Secondly you need to understand this functions:
TweenService:GetValue (roblox.com)
and
CFrame (roblox.com)

CFrame CFrame:Lerp ( CFrame goal, number alpha )

And finally checkout this topic that I shared before:
How would I offset the camera with rotation? - Help and Feedback / Scripting Support - DevForum | Roblox
My solution use CFrame math, so it works for CFrame position and rotation, not just rotation!
Otherwise I might be able to make a video on how to do it later :slight_smile:

So I need to use CFrame:Lerp right? Well if you can make video Iā€™m gonna feel thankful, but thatā€™s on you, once again thank you.

1 Like
local oldOffset = CFrame.new() -- Don't edit this!
local offset = CFrame.new()

-- (Optional): Will accumulate the time in seconds since the script started
local t = 0

game:GetService("RunService").RenderStepped:Connect(function(delta)
	-- (Optional): Accumulate the time in seconds
	t += delta
	-- Cancel out the offset we applied in the previous frame
	cam.CFrame *= oldOffset:Inverse()
	-- Apply the new offset
	cam.CFrame *= offset
	-- Store the offset we have applied so we cancel it in the next frame
	oldOffset = offset
	-- Update the offset that will applied!
	offset = CFrame.Angles(math.sin(t), 0, 0)  --You can change this however you want!
	-- Proof (Optional): You can update the original cframe without affecting the offset
	cam.CFrame *= CFrame.new(math.sin(t)*10, 0, 0) --You can change this however you want!
end)

Ahh so this is your script right? So you mean by it can also for position is like changing the offset lets say
offset = CFrame.new(math.rad(45), 0, 0)

1 Like

Yes, let me clarify what each thing is for:
1 - My video will help you to start understanding cframes at a basic level and give you the resources to build on what I taught (in video description)
2 - TweenService:GetValue, you can give it the alpha (percentage from 0 to 1), easingStyle and easingDirection and it will give you back a new alpha (percentage from 0 to 1) value depending on the easingStyle and easingDirection.
3 - CFrame:Lerp(), you need to use it with the solution I provided in the last link with the alpha value you got from TweenService in step 2.
4 - Enjoy!

But can I implement it because I have more than one part, i can use the same as my script?
Like for i, v in pairs(CameraScenes:GetChildren()) do
then do the CFrame:Lerp inside it?

1 Like

Possibly, am not exactly sure what youā€™re trying to do
but my script gives you a extra cframe that you can control without overriding the original cframe.
I guess, you need multiple offsets built on each other, but let me know what youā€™re trying to do exactly, maybe like a demo video or game?

Have you see the link that I gave above?

1 Like

Can you send me that gameā€™s link?
Gyazo

This game

1 Like

Also lerp is like this?

game:GetService("RunService").RenderStepped:Connect(function()
   for i, v in pairs(CameraScenes:GetChildren()) do
         cam.CFrame = v["1"].CFrame
         cam.CFrame = cam.CFrame:lerp(v["2"].CFrame, 0.5)
   end
end)
1 Like

I just played the game, now I know exactly what youā€™re talking about.
I made something like it before years ago for a commission, Iā€™ll try to make a video soon!