Files
LuckerGame/code/EntityComponents/Pawn/PawnAnimator.cs
2023-08-02 19:47:53 -04:00

22 lines
551 B
C#

using Sandbox;
using System;
namespace LuckerGame.Components.Pawn;
public class PawnAnimator : EntityComponent<Entities.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();
}
}
}