Camera Tween question

Hya! Thanks for coming here, I got a little problem. (Camera Player Tween onto the screen)

So I’m making a temperature scanner for my Airport and due to the scanner being a small screen. I would like the players camera to move to the scanners screen for the person to see. Here it how it looks like,

I have a ProximityPrompt on it for it to turn on and do what ever it does in normal script.

It would be nice if someone could tell me how it can be done and what steps I have to.

Extra Information which could help-
-A group model with a normal script for the scanner to work.
-Uses a proximityprompt and in the code proximity:function activates the script to work.

Reply if you need anymore information to help!~
I’ll will give the solution works comfirmation when sloved, Thanks!

1 Like

You could create a small transparent part infront of your scanner’s screen and simply tween the players camera to the part, once the proximity prompt has been activated.

2 Likes

Do you know the code for that, that’s a very good idea.

got you

local invisiblePart = workspace.InvisibleCameraPart

game:GetService("TweenService"):Create(workspace.CurrentCamera, TweenInfo.new(1), {CFrame = invisiblePart.CFrame}):Play()
2 Likes

Does this need to be in local script or in the code that the scanner works which is a normal script?

Local script since it controls the camera, which is local :sunglasses:

1 Like

Making sure , I’ll check now the code.

Um, it isn’t working, as always I have done something wrong.

local invisiblePart = script.Parent.Parent.InvisibleCamera
local proxmy = script.Parent.ProximityPrompt

proxmy.Triggered:Connect(function()
	game:GetService("TweenService"):Create(workspace.CurrentCamera, TweenInfo.new(1), {CFrame = invisiblePart.CFrame}):Play()
end)

any errors in the output? i dont see anything wrong with it

1 Like

Nope, nothing that I can see in the output. Click on the link for what it shows.

Baseplate - Roblox Studio (gyazo.com)

1 Like

Is the part anchored?

char=30
char=30

1 Like

The invisible camera or the scanner?

The invisible camera

char=30
char=30

1 Like

If thats not the issue then it has to be with the ProximityPrompt system you have

1 Like

I’ll check if it works if add click detection. But yes the whole model is anchored and the camera.
Click on link below.
Baseplate - Roblox Studio (gyazo.com)

Nope doesn’t even work with Clickdetection.

:frowning: sad days

I kept a 2 second wait in the main script for the camera to move but I think has nothing to do with the main script as the camera isn’t moving but the scanner is working.

try do… before the script runs try type in the first line

if not game:IsLoaded() then game.Loaded:Wait() end 

this checks if the whole game and its assets are loaded in however i dont think this is part of the problem

1 Like

I put it into the main script and now the script isn’t working (the scanner). Does that mean maybe an asset isn’t loading in my game stopping the camera from working?

1 Like
--if not game:IsLoaded() then game.Loaded:Wait() end   
local cam = workspace.CurrentCamera
local invipart = script.Parent.Parent.InvisibleCamera
local clickdetect = script.Parent.ClickDetector
local tws = game:GetService("TweenService")
clickdetect.MouseClick:Connect(function() -- leave this empty as theres no purpose to change the player state but the camera right?
  tws:Create(cam,TweenInfo.new(1),{CFrame = invipart.CFrame}):Play()
end) 

make sure this is in a localscript

edit: Im not sure how the scanner works but is it necessary for the the camera code? no need to show the scanner script just wanna know

1 Like

In my mind this should work but it doesn’t I have runned out of ideas. The should of been just a simple code to be implemented but turned out to be a hassle.