FixedUpdate Input System
by
null
| Summary | Utility system for polling input reliably in FixedUpdate |
|---|---|
| Description |
FixedUpdate Input System A utility System for polling input in an Update loop to use in a FixedUpdate loop without missing inputs in-between FixedUpdate ticks. How to use it: namespace Sandbox; public sealed class ExampleComponent : Component { private FixedUpdateInputSystem _fixedInput; protected override void OnStart() { // Get a reference to the system. _fixedInput = Scene.GetSystem(); base.OnStart(); } protected override void OnFixedUpdate() { // Query for input like normal. if ( _fixedInput.Pressed( "jump" ) ) { Log.Info( "Jump" ); } base.OnFixedUpdate(); } }FixedUpdate Input System
A utility System for polling input in an Update loop to use in a FixedUpdate loop without missing inputs in-between FixedUpdate ticks.
How to use it:
namespace Sandbox;
public sealed class ExampleComponent : Component
{
private FixedUpdateInputSystem _fixedInput;
protected override void OnStart()
{
// Get a reference to the system.
_fixedInput = Scene.GetSystem();
base.OnStart();
}
protected override void OnFixedUpdate()
{
// Query for input like normal.
if ( _fixedInput.Pressed( "jump" ) )
{
Log.Info( "Jump" );
}
base.OnFixedUpdate();
}
}
|
| Votes | 👍1 👎0 ❤️1 |
| Error Rate | 0% |
| Reviews |
1 reviews
100% Recommended (1)
0% Promise (0)
0% Needs Work (0)
|
| Data | {} |
Loading history…