#proximity prompt camera tweening
1 messages · Page 1 of 1 (latest)
setup a part that faces the exact place you want to
then just set the players camera type to "scriptable"
and tween the position of the camera to that part
how do i do this?
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable```
and where do i put this at?
** You are now Level 2! **
@junior bane
before the camera script?
in a local script in starter player scripts
or starter character scripts
depends where u want it to do it at
i understand the part and facing it where it needs to be, but im having a hard time figuring on how to trigger it with the promixty prompt is trigger
if u want it everytime a player resets/spawns then starter character scripts
if its just one time at join
starter player
so do i put it in my proximity prompt part?
local scripts dont really run in workspace
ahh okay
put it in starter player
then just get the prompt via like
local prompt = workspace:WaitForChild("promptPart")
then
prompt.Triggered:Connect(function()
-- previous camera code here
end)
so some like this?
no no no
oh..
local script goes into "StarterPlayerScripts"
local TweenService = game:GetService("TweenService")
local camera = workspace.CurrentCamera
local targetPart = workspace:WaitForChild("CameraPart")
local prompt = workspace:WaitForChild("Part"):WaitForChild("ProximityPrompt")
local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Quart,
Enum.EasingDirection.Out
)
prompt.Triggered:Connect(function()
camera.CameraType = Enum.CameraType.Scriptable
local cameraTween = TweenService:Create(camera, tweenInfo, {
CFrame = targetPart.CFrame
})
cameraTween:Play()
end)```
i paste this into the local script thats in the proximity prompt?
okay i did it
then paste that code into that script
and change the targetPart and prompt paths as needed
thank you so much
it worked
one question, if i ever wanted to get out of it and put it back to the players orignal camera. What do I do?
@junior bane
set it back
camera.CameraType = Enum.CameraType.Custom
do i put this into the same script ?
once the tween is done just put that
unless you want it to switch back after a specific action
like a button press
,etc
if so
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
yea i want when a player presses a button it goes back
put this where?
local script under the button
script.Parent.MouseButton1Click:Connect(function()
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end)```
smth like that
how to make it only pop up when the player gets to the camera