- Home /
UI button adding existing scrip to move 2d character
I am working on a 2D Game and firstable i develop the game in Desktop platform, but i want to migrate to mobile version. In Desktop Version the character moves with the left/right arrow keys. The character contains sprites, colliders and a rigidbody and thanks to the script, i can move it.
In the FixedUpdate() Function is where the movement script of my character is located.
Now, when i was creating the UI button to interact with the game contect in a mobile device, i was trying to create the event OnClick but, when i associate the script, does not show me the FixedUpdate() to pick, so i can move the character through the UI Buttons.
I dont know if i have to create a new function with movement script and not place the script inside of the FixedUpdate() or how can i handle the character movement that i have already with the UI Buttons?