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
public CharacterController()
No results match this filter.
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
No results match this filter.
Properties
Showing 13 properties
public float Sandbox.CharacterController.Acceleration { get; set; }
public float Sandbox.CharacterController.Bounciness { get; set; }
When jumping into walls, should we bounce off or just stop dead?
public BBox Sandbox.CharacterController.BoundingBox { get; set; }
public float Sandbox.CharacterController.GroundAngle { get; set; }
public Sandbox.Collider Sandbox.CharacterController.GroundCollider { get; set; }
public Sandbox.GameObject Sandbox.CharacterController.GroundObject { get; set; }
public float Sandbox.CharacterController.Height { get; set; }
public Sandbox.TagSet Sandbox.CharacterController.IgnoreLayers { get; set; }
public bool Sandbox.CharacterController.IsOnGround { get; set; }
public float Sandbox.CharacterController.Radius { get; set; }
public float Sandbox.CharacterController.StepHeight { get; set; }
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`.
public Vector3 Sandbox.CharacterController.Velocity { get; set; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.CharacterController |