Hey there Support, I’m trying to design a camera system for my top-down roguelite, cross platform between all platforms.
I’m having an issue where using the function Camera:Zoom(zoomvalue) [referencing the devwiki: Camera] is returning the following error:
(note - this function is bound via contextactionservice)
ContextActionService: Unexpected error while invoking callback: The current identity (2) cannot Zoom (lacking permission 5) - Studio
here is my code for reference:
local function changeZoomLevel(x, y, z)
if character == nil then return end
print("ZOOM")
if y == Enum.UserInputState.End then
return
end
if y == Enum.UserInputState.Begin then
if zoomLevel == 1 then
Camera:Zoom(45)
zoomLevel = 2
elseif zoomLevel == 2 then
Camera:Zoom(90)
zoomLevel = 3
elseif zoomLevel == 3 then
Camera:Zoom(25)
zoomLevel = 1
else
Camera:Zoom(25)
zoomLevel = 1
end
end
end
Now at the end of the day I hate having to make a button for zoom and to set the camera to scriptable, however I cannot prevent the player from looking around while still retaining the zoom features on Xbox and Mobile. I’m currently testing to see if using ContextActionService to bind up controller zoom button and mobile dragging is worth it instead, however if there are any other ways to fix this error I would appreciate the advice.
Thanks!