How do you climb ladders using touch controls?
I can move left and right without a problem but if I'm near a ladder I can't move up or down on it. It works fine if I'm using keyboard controls and moving up or down on the ladder but when I switch platforms to android the up and down touch buttons don't work while the keyboard buttons do still work when they shouldn't. I think I have to put
//#if UNITY_STANDALONE || UNITY_WEBPLAYER
and
//#endif
to stop the keyboard buttons from working but I'm not sure where. This is where I put it in my jump animation.
and here is the function for climbing ladders:
and here is the code for the touch controls:
you can see in the inspector what I'm using to set up the touch controls and they are the same as the left/right controls.
Am I doing anything wrong? Where do I put the
//#if UNITY_STANDALONE || UNITY_WEBPLAYER
and
//#endif
statements?
Your answer
![](https://koobas.hobune.stream/wayback/20220612111905im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Touchscreen Movement?? 1 Answer
New input system and touch on webgl 1 Answer
Touch Joystick not working properly with multiple touches 0 Answers
Unity 2d android game How to "freeze" position on Y axis 1 Answer
i want to add touch controlls to my game. how can i do so? *free candy for whoever helps me out* 1 Answer