Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Modifying unity's Joystick pack scripts

So recently I've been making a whiteboard app.so I've the board bigger so users can get more space to write and I'm worried about hot the user will pan the camera so I've decided to use the joystick.


I quickly downloaded the unity joystick pack for free and then i just mapped the joystick horizontal ant vertical values to my desized bounds. But it keep going back to zero after i release the joystick so modified the code of base joystick script to only snap back to 0 when released the stick if i enabkes a boolean .


And it worked as i expected but my board is rectangular and the joystick is round so it dont shows the corner.


Anybody has a idea how i can i make this joystick to work as a rectangular stick so i can have both vertical and horizontal values to its bounds at same time.


@Mouledoux @Brackeys

Answers

  • A joystick should give you 2 vales; one for X, and one for Y.

    Instead of setting you camera position to that of the joysticks, you need to MOVE the camera by the joystick amount, and do your bounds checks on the camera so it stays on the board.

Sign In or Register to comment.