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

Inhibit Input

$
0
0
Hi,

In our game, when a goal is detected we want to wait some seconds and then reset characters and ball positions.
When we do this, we also disable all input for characters.

Unfourtunately, when we move all positions, input coming from previous frames is applied and characters are moved before the new kick off.

(Reset and kick off always occurs in safe tick)

Is there a way to "inhibit" input? Something like:

TrueSyncManager.InhibitInput();
that do something like this:


TrueSyncManager::InhibitInput()
{
m_InputEnabled = false;
}
.
.
.
TrueSyncManager::OnStepUpdate()
{
.
.
.
if ( i_AllInputData != null )
{
for (int index = 0; index < i_AllInputData.Lenght; ++index)
{
InputData inputData = i_AllInputData[index];

if (m_BehavioursPerPlayer.ContainsKey ( inputData.ownerId ))
{
TrueSyncInput.CurrentSimulationData = (m_InputEnabled) ? inputData : null;
.
.
.
}
}
}
}

Actually the problem with this solution is that if CurrentSimulationData is null and anyone try to call:

TrueSyncInput.Get ( byte ) ;

the game throw an exception. Is it possible to return a default value instead?
Or do you have planned any workaround for this?

Thank you.

Best regards,
Andrea.

P.S. Obviously InhibitInput function should be call just in safe tick frame.

Viewing all articles
Browse latest Browse all 15755

Trending Articles