Live Production Software Forums

Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
#1 Posted : Saturday, May 20, 2023 5:19:10 AM(UTC)

Rank: Advanced Member

Groups: Registered
Joined: 3/30/2023(UTC)
Posts: 57
United States
Location: Chicago

Thanks: 8 times
Was thanked: 2 time(s) in 1 post(s)

I had ChatGPT create the following script. However, there are some syntax errors and I'd like to ask for any assistance with this I can get. Although I used to code, many years ago, I've not touched scripting in anyway meaningful for a long time so please understand why I reach out.

Here's the code:

Function JoystickMove()
'Get the current position of the layer
Dim x As Integer = Layer(1).PositionX
Dim y As Integer = Layer(1).PositionY

'Get the current scale of the layer
Dim scaleX As Integer = Layer(1).ScaleX
Dim scaleY As Integer = Layer(1).ScaleY

'Get the joystick input values
Dim joyX As Integer = Joystick(1).X
Dim joyY As Integer = Joystick(1).Y

'Calculate the new position of the layer based on joystick input
x += joyX * 10
y += joyY * 10

'Calculate the new scale of the layer based on joystick input
scaleX += joyX * 2
scaleY += joyY * 2

'Set the new position and scale of the layer
Layer(1).PositionX = x
Layer(1).PositionY = y
Layer(1).ScaleX = scaleX
Layer(1).ScaleY = scaleY

End Function

'Call the JoystickMove function every frame (30 times per second)
AddPeriodicCallback("JoystickMove", "JoystickMove", 33)

So, looks like it *should* be good but it's throwing an error on the End Function.

Any advice would be appreciated. It's unfortunate that the vMix developers have left this feature (joystick positioner) out of the app and have the community rely on it's own devices to implement.

Thanks in advance.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.