Is there any way to set the opacity of the virtual joystick from C++? What I’ve done is created a player controller class and added a getter for the virtual joystick, but I can’t seem to find any methods for setting its opacity. I tried using ‘SetRenderOpacity’, but it didn’t seem to work. Let me know if any of you have a solution for it.
The actual thing i m trying to do is , make it fade when the joystick is not active, and yes i know it has a built in thing to do it from the Touch Interface but wont work if “PreventRecenter” is ticked, i want that to enabled as well as have it fade and be not visible when not active/when player touch it! I want the joystick to me fixed on a position.
Hi, I’m not sure if you can change it directly in default virtual joystick - try changing ActiveOpacity and InactiveOpacity variables.
But if this doesn’t work, just copy DefaultVirtualJoysticks class from the Engine Content, adjust opacity to your needs and change it to use your new VirtualJoystick.
Ah right, sorry.
But default engine virtual joystick inherits from UTouchInterface. It definitely works to create your own, as I’ve done this for my game. You can even change touch interfaces in runtime.
I have done that already, the problem is i want the joystick to be fixed in a pos by enabling Prevent Recenter but if you do so, the joystick will stay active and wont disable when not in use
I see sorry, it indeed doesn’t change opacity when you set PreventRecenter to true.
You can access touch interface from PlayerController, CurrentTouchInterface protected variable.
It works very weird but maybe you can work something out from this.
Yep, i tried that and it works sometimes and sometimes not! Tried finding some other way but seems not possible unless i change the source file some what to my needs!