#Camera Shananigans
73 messages · Page 1 of 1 (latest)
What the hell are you doing in that first function?
Well as I’m on mobile and cooking at the same time I can’t quite fix the entire code but try to use tweens normally
You can do a lot with tweens and renderstep loops
I tried for 4 hours to fix it. Right now I am doing something else in unity
who pinged me again
Are you at your PC now?
Could you post script here with the code block style i am on mobile


I mean i am a GitHub enjoyer so I guess I will

My phone nearly imploded
Anyways what is the issue with the script
@scenic granite
Will this work?
You are "for hire" but do all this for free, what a samarithan
solved
well, I like helping people.
sure
Btw @unique field apparently you changed this ```lualocal function startcampos()
Camera.CameraType = Enum.CameraType.Scriptable
local targetPosition = Vector3.new(78.066, 7.212, 5.476)
local targetOrientation = Vector3.new(-2.402, -89.24, -0)
local function pointCamera(position, orientation)
Camera.CFrame = CFrame.new(position, position + orientation)
end
local cameraOrientation = calculateOrientation(Camera.CFrame.Position, targetPosition)
pointCamera(targetPosition, cameraOrientation * CFrame.Angles(math.rad(targetOrientation.x), math.rad(targetOrientation.y), math.rad(targetOrientation.z)).lookVector)
end``` quite much and now the camera doesn't go there at the beggining of the trigger
Implemented it just now, everything works just this
oh yeah. I'm sorry about that.
It's quite an important part. Because the camera isn't in the right place at the beginning
Please, help me fix it?
im on pc
@mighty ridge If your on pc and know with CFrames please integrate this bit ```lua
local function startcampos()
Camera.CameraType = Enum.CameraType.Scriptable
local targetPosition = Vector3.new(78.066, 7.212, 5.476)
local targetOrientation = Vector3.new(-2.402, -89.24, -0)
local function pointCamera(position, orientation)
Camera.CFrame = CFrame.new(position, position + orientation)
end
local cameraOrientation = calculateOrientation(Camera.CFrame.Position, targetPosition)
pointCamera(targetPosition, cameraOrientation * CFrame.Angles(math.rad(targetOrientation.x), math.rad(targetOrientation.y), math.rad(targetOrientation.z)).lookVector)
end ```
with the script ScriptedInterface sent
I tried but it always doesn't work
toughts?
.
You can put it in studio, it's pretty hard to explain it
basicly it doesn't tween if i add this bit
.
But add it in studio cuz its hard to fix
Then you should set the correct position before anything starts.
That's what this bit does
So you want the camera to go there on the spot when the player interacts with the prompt?
Yeah so when the proxy prompt is triggered the cam goes there. and from there it tweens to those numbers
Not when the prompt trigger is finished?
Yes ur right
Referring to the Roblox API, you should use
PromptButtonHoldBegan(playerWhoTriggered: Player).
https://create.roblox.com/docs/reference/engine/classes/ProximityPrompt
Lastly, here's the list of the events of a proximity prompt:
Yeah but I got issues with the camera not really the trigger it works ok
Just this bit```lua
local function startcampos()
Camera.CameraType = Enum.CameraType.Scriptable
local targetPosition = Vector3.new(78.066, 7.212, 5.476)
local targetOrientation = Vector3.new(-2.402, -89.24, -0)
local function pointCamera(position, orientation)
Camera.CFrame = CFrame.new(position, position + orientation)
end
local cameraOrientation = calculateOrientation(Camera.CFrame.Position, targetPosition)
pointCamera(targetPosition, cameraOrientation * CFrame.Angles(math.rad(targetOrientation.x), math.rad(targetOrientation.y), math.rad(targetOrientation.z)).lookVector)
end ``` needs somehow to be integrated with the 1 you sent to me
this?
This
It worked but messed up the intial cam pos
local function startcampos()
Camera.CameraType = Enum.CameraType.Custom
local targetPosition = Vector3.new(78.066, 7.212, 5.476)
local targetOrientation = Vector3.new(-2.402, -89.24, -0)
moveCameraTarget(targetPosition, targetOrientation)
end
``` tried to modify this but idk why it won't work
This is how you modified it and the one I sent you is how it supposed to be, since you made the script, toughts?
let me go to github again
Ok
** You are now Level 8! **
local Camera = game.Workspace.CurrentCamera
local proxy = game.Workspace.FinishDemo.ProximityPrompt
local CameraTarget = Instance.new("Part")
CameraTarget.Name = "CameraTarget"
CameraTarget.Anchored = true
CameraTarget.CanCollide = false
CameraTarget.Transparency = 1
CameraTarget.Parent = game.Workspace
local function moveCameraTarget(position, orientation)
CameraTarget.CFrame = CFrame.new(position) * CFrame.Angles(math.rad(orientation.x), math.rad(orientation.y), math.rad(orientation.z))
Camera.CameraSubject = CameraTarget
end
local function startcampos()
Camera.CameraType = Enum.CameraType.Custom
local targetPosition = Vector3.new(78.066, 7.212, 5.476)
local targetOrientation = Vector3.new(-2.402, -89.24, -0)
moveCameraTarget(targetPosition, targetOrientation)
end
local RunService = game:GetService("RunService")
local function tweenCamera(position, orientation, duration)
local initialPosition = Camera.CFrame.Position
local initialOrientation = (position - initialPosition).unit
local startTime = os.clock()
local endTime = startTime + duration
local function updateCamera()
local currentTime = os.clock()
local timeFraction = (currentTime - startTime) / duration
if timeFraction >= 1 then
moveCameraTarget(position, orientation)
RunService:UnbindFromRenderStep("CameraTween")
else
local newPosition = initialPosition + (position - initialPosition) * timeFraction
local newOrientation = initialOrientation:Lerp(orientation, timeFraction)
moveCameraTarget(newPosition, newOrientation)
end
end
RunService:BindToRenderStep("CameraTween", Enum.RenderPriority.Camera.Value, updateCamera)
end
proxy.Triggered:Connect(function()
startcampos()
wait(0.5)
tweenCamera(Vector3.new(44.69, 93.795, 6.245), Vector3.new(-8.687, -69.63, 0), 4)
end)
Thanks
@unique field , sorry for ping but you know how to disable the player from moving the camera?
I don't know about that one. Sorry man.
** You are now Level 19! **
I got to go now.