Why wont my camera part not go down?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I made a tablet part that goes up everytime you click a key on your keyboard. The tablet part tweens up perfectly fine but it wont work when i try and make it go down.

  2. What is the issue? Include screenshots / videos if possible!
    I dont know what im doing wrong

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried YT and Devforum

Here is my open code:

RunService.RenderStepped:Connect(function()
    local Monitor = game.ReplicatedStorage.Monitor:Clone()
    Monitor.Parent = game.Workspace.CurrentCamera
	local MonitorPart = Monitor:FindFirstChild("Monitor")
	local MonitorDown = Monitor:WaitForChild("MonitorDown")
	local MonitorUp = MonitorPart.Parent:WaitForChild("MonitorUp")
	local ts = game:GetService("TweenService")
	local openMonitor = ts:Create(MonitorPart, TweenInfo.new(0.3), {CFrame = MonitorUp.CFrame})
				
	openMonitor:Play()
end)

Here is my close code:

RunService.RenderStepped:Connect(function()
	local Monitor = game.Workspace.CurrentCamera:WaitForChild("Monitor")
	local MonitorPart = Monitor:FindFirstChild("Monitor")
	local MonitorDown = Monitor:WaitForChild("MonitorDown")
	local MonitorUp = MonitorPart.Parent:WaitForChild("MonitorUp")
	local ts = game:GetService("TweenService")
    local closeMonitor = ts:Create(MonitorPart, TweenInfo.new(0.3), {CFrame = MonitorDown.CFrame})

	closeMonitor:Play()
end)
2 Likes

You’re using a RenderStepped loop to play tweens, which is really odd to me. In the code that you’ve provided, tweens will constantly be created and played.

Instead of using a RenderStepped loop, try tweening without it.

2 Likes

I put them in render stepped because i had other code in there which i used to make a part follow the camera so i threw the tweens in there too and it works so yea

1 Like

Is there any errors or anything?

There’s a lot of odd things to put in RenderStepped loops here, like cloning parts and creating tweens.

2 Likes

Oh my bad the cloning part was actually outside of the loop, also i get zero errors

1 Like

I honestly don’t know what the issue is.

All I see are things like making the MonitorDown, MonitorUp, Monitor, and MonitorPart parts their own variable outside the scope, and the other things regarding the tweens.

2 Likes

Don’t worry I figured it out :smiley: Its hard to explain though

2 Likes

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