

SplineLocation = GameStateRef-> MovementSpline-> Spline-> GetLocationAtDistanceAlongSpline(GameStateRef-> MovementSpline-> DistanceAtStart, ESplineCoordinateSpace::World) Ĭase ESplineLocationStatus::SL_ReachedEnd : NOTE: Could use a ternary for this but decided a switch was more readableĬase ESplineLocationStatus::SL_ReachedBegin : If (ClampToSpline & SplineStatus != ESplineLocationStatus::SL_OnSpline) If we're at the end of the spline and are clamping movement, stop the player. SplineStatus = GameStateRef-> MovementSpline-> ReachedSplineLimit( GetActorLocation() + GetCharacterMovement()-> GetPendingInputVector() * 50. SplineDirection = GameStateRef-> MovementSpline-> Spline-> FindDirectionClosestToWorldLocation( GetActorLocation(), ESplineCoordinateSpace::World) ĪddMovementInput(SplineDirection, Value) Orient and move player in the direction of the spline


If (GameStateRef = nullptr || GameStateRef-> MovementSpline = nullptr)ĪddMovementInput( FVector( 0. Void ASplineCharacter::MoveRight( float Value)
