- Home /
How can I stop UI Raw Img disappearing during GetMouseButton()?
I have a script to move my player, using RMB held down on an on-screen virtual trackball. The script itself works as expected.
if (Input.GetMouseButton (0)) {
//some calcs
transform.Translate(playerMoveX * Time.deltaTime, playerMoveY * Time.deltaTime, 0);
}
However, while the mouse button is held down, the UI Raw Image that contains the trackball graphic (and other nifty elements) disappears. It reappears when I let the mouse button up.
If I use Input.GetMouseButtonDown (), I don't have this problem but I lose the functionality of being able to mouse around the screen smoothly.
Is there any way of keeping the raw image visible while holding the mouse button down?
Many thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220613164942im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Request feedback for C# script (instantiating UI elements depending on Player Input) 0 Answers
How to make a GUI Tabel. 0 Answers
Circle Chart Asia style UI, 1 Answer