Create FPS Test minigame with other shit
This commit is contained in:
20
code/Minigames/FpsTest/PawnAnimator.cs
Normal file
20
code/Minigames/FpsTest/PawnAnimator.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Sandbox;
|
||||
|
||||
namespace LuckerGame.Minigames.FpsTest;
|
||||
|
||||
public class PawnAnimator : EntityComponent<Pawn>, ISingletonComponent
|
||||
{
|
||||
public void Simulate()
|
||||
{
|
||||
var helper = new CitizenAnimationHelper( Entity );
|
||||
helper.WithVelocity( Entity.Velocity );
|
||||
helper.WithLookAt( Entity.EyePosition + Entity.EyeRotation.Forward * 100 );
|
||||
helper.HoldType = CitizenAnimationHelper.HoldTypes.None;
|
||||
helper.IsGrounded = Entity.GroundEntity.IsValid();
|
||||
|
||||
if ( Entity.Controller.HasEvent( "jump" ) )
|
||||
{
|
||||
helper.TriggerJump();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user