Bro Code logoBRO CODE CRINDEPENDENT GAME DEV TOOLS
← All abilities
ABILITY 07

Teleport

Press once to aim toward the mouse, then press again to teleport within the configured distance.

Activation

TeleportButton

Example use

A short directional teleport during a platforming sequence.

Ability documentation
CHARACTER ABILITY
SETUP GUIDE

Set up this ability

Component
CharacterTeleport
Source
Scripts/Abilities/CharacterTeleport.cs
Animator bools
TeleportAim, TeleportFire

Component dependencies

Requirements for this ability and its targets
ComponentWhere to add or assign itPurpose / setup
Camera tagged MainCameraSceneRequired for updating the mouse-aimed destination.

Visual component dependencies

These components support the associated effect. A missing optional visual does not by itself imply that the gameplay mechanic cannot run.

Visual dependencies
ComponentWhere to add or assign itPurpose / setup
ReticlePrefabAssigned prefab fieldOptional destination marker. The included reticle uses TeleportReticle; a custom marker can provide its own visuals.
  1. Add CharacterTeleport to a CharacterPlus character using CustomInputManager.
  2. Assign the optional RecticlePrefab 1 to ReticlePrefab, and set TeleportDistance (default 4 world units).
  3. Use a camera tagged MainCamera. Mouse aiming uses the legacy input path.
  4. Create TeleportAim and TeleportFire bools in the character Animator.
  5. Press TeleportButton once to aim, move the mouse, then press it again to confirm. The aim point is clamped to TeleportDistance.

Inspector reference

These are C# field declaration defaults. Existing prefab and scene values can override them. Shared fields are documented under Ability Configuration.

CharacterTeleport fields
FieldTypeDeclared default
TeleportDistancefloat4f
ReticlePrefabGameObjectNot assigned in declaration

Usage notes

  • Confirmation uses CorgiController.TrySetSafeTransformPosition to resolve the destination against level collisions.
  • Teleport has custom two-press handling. It does not follow the generic ActivationDelay and toggle-off workflow.
  • Match your animation clip naming to the TeleportAim parameter used by the animation-duration helper.