How to trigger Camera Pan On Touch Drag of Gui element As it It weren't being touched

So I have a joystick Gui element that players drag to throw a smoke bomb:
image

The problem is that I use a shoulder camera and the smoke bomb is thrown out using a ray from the center of their screen (crosshairs):

ezgif.com-gif-maker

What I need to happen while the player is dragging this joystick is to pan the camera similar to the normal way when you touch drag on the screen anywhere else:

ezgif.com-gif-maker (1)

I need the camera to move as if it was a normal pan touch drag pan (like second video). Only I need to be able to control how much it pans (since the joystick area is smaller, I will need to control the amount it pans).

My thoughts so far:

  1. Is the a way to trigger the normal touch/drag events (passing in vars) to trigger the camera pan?

What’s the best way to programmatically trigger the camera pan to pan as normal (left, right, up, down and amount to pan)?

Looked on developer and just am lost what’s the best way.

2 Likes

So one solution I have found is to set the Frame and the btn Active property to false. This Allows the touch drag event to pass through and trigger the normal camera panning movement while still moving my draggable button.

https://developer.roblox.com/en-us/api-reference/property/GuiObject/Active

This is close enough:

2 Likes