-
What do you want to achieve? Hello, i want the camera to be able to be moved while shooting on mobile.
-
What is the issue? I use the ContextActionService to make mobile buttons, but when i press it and try to move my camera, it dosen’t.
This are the current mobile functions:
Connections["MOBILE_FIRE"] = function(actionName, inputState, inputObject)
print(inputState)
if inputState == Enum.UserInputState.Begin then
Shooting = true
MobileShootAim = true
elseif inputState == Enum.UserInputState.Cancel then
Shooting = false
MobileShootAim = false
end
return Enum.ContextActionResult.Pass
end
Connections["MOBILE_AIM"] = function(actionName, inputState, inputObject)
--print(inputState)
if inputState == Enum.UserInputState.Begin then
print(MobileShootAim)
if MobileShootAim == false then
if Aiming == false then
Connections["AIM"](true)
else
Connections["AIM"](false)
end
end
end
return Enum.ContextActionResult.Pass
end
ContextActionService:BindAction("MOBILE_AIM", Connections["MOBILE_AIM"], true)
ContextActionService:BindAction("MOBILE_FIRE", Connections["MOBILE_FIRE"], true)
ContextActionService:SetTitle("MOBILE_AIM", "Aim")
ContextActionService:SetTitle("MOBILE_FIRE", "Fire")
ContextActionService:SetPosition("MOBILE_AIM", UDim2.new(0, 110, 0, 20))
ContextActionService:SetPosition("MOBILE_FIRE", UDim2.new(0, 40, 0, 60))
-
What solutions have you tried so far? I tried doing
return Enum.ContextActionResult.Passat the end of my shoot function but it dosen’t work.