0
\$\begingroup\$

Learning from some tutorials. Made Swipe touch scene. Have UI(virtual joystick) on canvas screen overlay. The problem is,when I am rotating character by joystick, my camera rotating too. If I've pressed on my UI, swiping script turning my camera around and I can't move the right way. How can I solve this problem?
@Byte56 So your camera is rotating, when you're trying to steer using your on screen joystick?
Yes

\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

This is a common problem, a common solution is to use a global flag. Basically, when your UI accepts input, you set a global flag (something like UIConsumingInput) to true. If you have any other inputs, like your camera rotation, you have it test to see if UIConsumingInput is set to true, if UIConsumingInput is true, you don't process input.

\$\endgroup\$
1
  • \$\begingroup\$ The problem was with my scene... My changes in scripts were not implemented into the build. Don't know why... Anyway, I made changes that you wrote above earlier and I will mark it as the right answer. \$\endgroup\$ Commented Jun 8, 2017 at 10:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .