Hello everyone. I am a novice developer and I would like to make a computer system like in fallout. When you click on it, the camera moves smoothly closer
I want to make it so that when you click on the computer, the player’s camera moves smoothly to it
The problem is that I have already tried to implement such a camera via RemoteEvent, but nothing worked out for me
I’ve been looking for a solution but I haven’t found anything.
you can Tween the camera CFrame, to move in front of the computer smoothly.
I dont know why you would need a RemoveEvent but if you want to do this, just Tween the workspace.CurrentCamera.CFrame to the position you like the client.
So you need it to just move camera slowly to computer?
You can create part and name it like “CameraPart” and make it invisible then through LocalScript and TweenService make tween:
local Camera = workspace.CurrentCamera
local CamPart = workspace:WaitForChild('CameraPart')
local TweenService = game:GetService('TweenService')
local params = TweenInfo.new(
6, -- time
Enum.EasingStyle.Exponential
)
local target = {
CFrame = CamPart.CFrame
}
local tween = TweenService:Create(Camera,params,target)
Camera.CameraType = Enum.CameraType.Scriptable
tween:Play()
to make it go back you can do the same but the target will be players head and cameratype will be custom.
I don’t really understand how this can be implemented. For example, I tried to make the camera just change when pressing ProximityPrompt, but it didn’t work out.
local Camera = workspace.CurrentCamera
local CamPart = workspace:WaitForChild('CameraPart')
local TweenService = game:GetService('TweenService')
local offset = CFrame.new(0,0,5)
local params = TweenInfo.new(
6, -- time
Enum.EasingStyle.Exponential
)
local target = {
CFrame = CamPart.CFrame * offset
}
local tween = TweenService:Create(Camera,params,target)
Camera.CameraType = Enum.CameraType.Scriptable
tween:Play()
Thats with offset, you can change offset value as you want
Also theres service called as ProximityPromptService and it has event called PromptTriggered that returns in first argument the prompt that was triggered and you can just make object to move to first argument (promp that fired) parent
Okay I didn’t really understand how it works. I understood what Prompt Triggered is, but I didn’t understand how to activate another script from it. As I understand it, the script that you gave me only works in StarterPlayerScript