Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

SimulateOwner - GetKeyDown and GetButtonDown multiple events

$
0
0
I'm having a problem where Input events are raised multiple times in SimulateOwner. For example, the code:

public override void SimulateOwner() {
if (Input.GetKeyDown(KeyCode.F))
{
var flash = FlashColorEvent.Create(entity);
flash.FlashColor = Color.red;
flash.Send();
Debug.Log("simulate owner - " + Time.time);
}
}


If I run the project and press F one time, the GetKeyDown event happens twice:


The same problem happens with GetButtonDown and GetMouseButtonDown. If I move the Input code into Update instead of SimulateOwner I do not get multiple events.

Viewing all articles
Browse latest Browse all 15755

Trending Articles