Working on a commision my problem is that the camera doesn’t go on the right position.
This is where it’s supposed to be, when I use the CameraType “Scriptable”, it shows the right location, but I can rotate the camera around, which I do not want.
Changing the CameraType property to Scriptable, by default, does not track with mouse movement. Are you sure you are changing the correct Camera object? I believe that when the workspace.CurrentCamera object is destroyed it creates a new, default, camera with its CameraType property set to Fixed - therefore allowing camera rotation with mouse movement. Could this be your problem?
That works. Also, you could bind a function to listen for changes to the Workspace.CurrentCamera property. Whenever this property is changed, call a function which customizes any property of the Camera you need changed:
workspace.Changed:connect(function(propName)
if propName == "CurrentCamera" and workspace.CurrentCamera then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
end
end)
Of course you would then need a way to disable this event listener if the CurrentCamera is being reset later in the game and you don’t want its CameraType property to be Scriptable.