photo

[SOLVED] Custom controls keys

Recommended Posts

Posted (edited)

I need to do custom controls. By default i can see 
image.png.aac64175f97b51883aa76b63def967aa.png

and i can do it in World Editor
image.png.d8cb2b9c47f1c4866b7b44c633255ae7.png

But i need another controls actions. I can turn off this controls like this:
 

Game::getPlayer()->setControlled(0);

And include my own controls buttons
 

if (App::getKeyState('w')) {	
//some actions
}

but in this case i can see in menu old control buttons(like in the firs picture)
How i can write there my own buttons there and change name and actions (using for example callback)

Unigine::MakeCallback<..>(...)
Ptr<Controls> rr= Game::getPlayer()->getControls();

 

Edited by nicolay.nicolay

Share this post


Link to post

Hi Nicolay,

How i can write there my own buttons there and change name and actions
All you can do is to use STATE_AUX_0 - STATE_AUX_F: https://developer.unigine.com/en/docs/2.11/api/library/controls/class.controls?rlang=cpp
Then you need to show them in the Main Menu. Change the sdk/data/core/unigine.ui and sdk/data/core/scripts/system/system.h files (it is trivial).

P.S. But, I recommend to you creating your own Controls System. Our system very difficult to modify.

Best regards,
Alexander

Share this post


Link to post

Thank you !

Share this post


Link to post