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
\$\begingroup\$
\$\endgroup\$
0
Add a comment
|
1 Answer
\$\begingroup\$
\$\endgroup\$
1
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.
-
\$\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