I’m trying to set a combination of key (ctrl+G and ctrl+F), but the ctrl+F doens’t answer properly : the combination works only if i press F then ctrl, and i can’t find a way to make it work in the reverse. does anyone have an idea ?
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.G))
{
Debug.Log("Ctrl+G");
GameObject[] objects = Utilitaires.FindSelectedObjects();
for (int i = 0; i < objects.Length; i++)
{
variables o1 = (variables)objects*.GetComponent("variables");*
if (o1 != null)
{
o1.setMyObjectsGroup(objects);
}
}
}
if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyUp(KeyCode.F))
{
Debug.Log(“Ctrl+F”);
GameObject[] objects = Utilitaires.FindSelectedObjects();
for (int i = 0; i < objects.Length; i++)
{
GameObject[] thisObject = new GameObject[1];
thisObject[0] = objects*;*
variables o2 = (variables)objects*.GetComponent(“variables”);*
if (o2 != null)
{
o2.setMyObjectsGroup(thisObject);
o2.unselect();
}
}
}