Other
How to edit standard asset - universal single joystick - reduce joystick range of moment to avoid off screen
I want the mobile joysticks in this project to not go outside the screen. I have uploaded a video to youtube to show what is happening.
I want to reduce to overall range of of the stick but keep the movement of the player and camera relatively the same.
If you need the scripts please let me know.
thank you.
The YouTube video doesn’t work. The link doesn’t link to anything.
How are the virtual joysticks coded? Are they done entirely in C# or is there some weird UI chain in use? If C#, can you link it?
it is partially in c# and part UI elements. It is using the standard assets for universal single joystick.
Answer by Kudorado · Apr 25, 2018 at 02:05 PM
i can't watch the video but i suggest you using`Mathf.Clamp(min,max)` to clamp position x of joystick.
I re-uploaded the video and added a new link. check it out. https://youtu.be/baI47WV$$anonymous$$XYU
I need to reduce the area of both the x and y positions of the joystick.