Hey, so I have this script which is broken. What I want it to do is when a value is set to true, the camera of the person in the vehicleseat changes to what the “Fixed” position is. Like how the camera just locks into a position and cannot follow anything.
Below, I tried changing the currentcamera in workspace but I got lost and couldn’t figure out how to set it up. Any help would be appreciated.
while true do
local funnyvalue = script.Parent.Parent.Parent.Values.TemporalDisplacement.Value
local RunService = game:GetService("RunService")
RunService.Heartbeat:Wait()
if funnyvalue == true
then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
else
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end
end
Also this is the car I am working on, my idea is that the camera locks when the car disappears so you can see the time travel effect.
Alright, but how would I script the camera to be in the fixed position. I was told that if you were to do anything you would need to set it to Scriptable instead of Fixed.
That’s correct, you would need to do that. An idea would be to add a new part which will be the place where the camera’s position will be set and set the camera’s CFrame to the part’s CFrame (if that makes sense)
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = Car.CameraPos.CFrame -- CameraPos = the part which the Camera will position at
I get your idea, but I think it’s a problem with the script itself. It still isn’t updating the camera to the position of the attachment i set it to, and no errors show up in Output. I’m not sure it’s able to detect the localplayer in the vehicleseat and maybe that’s why it can’t change the camera, not sure
Local scripts don’t run in workspace. If you want to change the camera, use a server script and fire an event to the client which will change it locally
After setting the camera type to scriptable I would try doing this:
-- NOTE: This is untested and very much hypothetical. It isn't guaranteed to work.
local CameraCFrame = Camera.CFrame
Camera.Subject = nil
Camera.CFrame = CameraCFrame
Where do I put the remoteevent? I want to put it in the model itself so that my model is easily compatible with my other games, but a tutorial is telling me to put it in the ReplicatedStorage
Just move it to ReplicatedStorage. If you want to use the same model in different games, just drag the event into RS in that game, will work perfectly fine