s&box docs

public class Sandbox.CharacterController : Sandbox.Component

Allows collision constrained movement without the need for a rigidbody. This is not affected by forces and will only move when you call the Move() method.

Constructors

Showing 1 constructors

Methods

Showing 7 methods

public void Accelerate(Vector3 vector)

Add acceleration to the current velocity. No need to scale by time delta - it will be done inside.

public void ApplyFriction(float frictionAmount, float stopSpeed = 140)

Apply an amount of friction to the current velocity. No need to scale by time delta - it will be done inside.

Parameters

  • stopSpeed: Default: 140

protected virtual void DrawGizmos()

public void Move()

Move a character, with this velocity

public void MoveTo(Vector3 targetPosition, bool useStep)

Move from our current position to this target position, but using tracing an sliding. This is good for different control modes like ladders and stuff.

public void Punch(Vector3 amount)

Disconnect from ground and punch our velocity. This is useful if you want the player to jump or something.

public Sandbox.SceneTraceResult TraceDirection(Vector3 direction)

Trace the controller's current position to the specified delta

Properties

Showing 13 properties

public float Sandbox.CharacterController.Bounciness { get; set; }

When jumping into walls, should we bounce off or just stop dead?

public bool Sandbox.CharacterController.UseCollisionRules { get; set; }

If enabled, determine what to collide with using current project's collision rules for the `Sandbox.GameObject.Tags` of the containing `Sandbox.GameObject`.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.CharacterController

On this page