Custom Maps & Logic
  • Custom Map Tutorial
    • Custom Map Introduction
    • Your first map
    • Map Navigation
    • Object Selection
    • Object Positioning
    • Object Attributes
    • Shortcuts and Macros
    • Editor Settings
    • Built-in Components Common Errors
    • Map Performance
    • Custom Assets
      • Your first Asset Bundle
      • Asset Bundles in Map Editor
      • Asset Bundles in Game
      • Adding to Asset Bundles
      • Asset Bundle naming
  • Custom Logic Tutorial
    • Custom Logic Introduction
    • Your first script
    • Variables
    • Types
    • Variable Inspector
    • Expressions
    • Conditionals
    • Loops
    • Functions
    • Coroutines
    • Classes
    • Static Classes
    • Components
    • Extensions
    • Cutscenes
    • Static Objects
    • Networking
    • Commenting
  • Reference
    • Static Classes
      • Game
      • Network
      • Map
      • UI
      • Time
      • Convert
      • String
      • Input
      • Math
      • Random
      • Cutscene
      • Camera
      • RoomData
      • PersistentData
      • Json
      • Physics
    • Objects
      • Component
      • Object
      • Character
      • Human
      • Titan
      • Shifter
      • MapObject
      • Transform
      • Player
      • NetworkView
      • Color
      • Vector3
      • Quaternion
      • Dict
      • List
      • Range
      • LineCastHitResult
      • MapTargetable
      • Random
    • Callbacks
      • Main
      • Components
  • Examples
    • Gamemodes
      • Survive
      • Waves
      • Endless
      • Racing
      • Blade PVP
      • Thunderspear PVP
      • Titan Explode
      • Cranked
      • More Examples
    • Components
      • SupplyStation
      • Daylight
      • PointLight
      • Rigidbody
      • NavMeshObstacle
      • Cannon
      • Dummy
      • Wagon
      • Tag
      • KillRegion
      • DamageRegion
      • MovePingPong
      • RacingCheckpointRegion
      • RacingFinishRegion
      • TeleportRegion
      • Animal
      • SignalMover
      • SignalSender
      • More Examples
Powered by GitBook
On this page
  1. Reference
  2. Callbacks

Components

These callback functions are available only on components. Components also have all the callbacks that exist in Main.

Function
Description

OnCollisionEnter(other: Object)

Called upon another object first colliding with the attached MapObject.

OnCollisionStay(other: Object)

Called every frame while another object is colliding with the attached MapObject.

OnCollisionExit(other: Object)

Called upon another object exiting collision with the attached MapObject.

OnGetHit(character: Character, name: string, damage: int, type: string, hitPosition: Vector3)

Called upon getting hit by a hitbox, such as a blade or titan attack. Only called if the MapObject has a collider of layer "Hitboxes" attached.

OnGetHooked(human: Human, hookPosition: Vector3, leftHook: bool)

Called upon getting hit by a hook. Only runs for your player character.

Network callbacks

The following callbacks are only available if the attached MapObject has the "Networked" option enabled in the map editor.

Function
Description

OnNetworkTransfer(oldOwner: Player, newOwner: Player)

Called upon the NetworkView changing ownership.

SendNetworkStream()

Called every frame for the owner. You can send a series of data, in order, by using self.NetworkView.SendStream.

OnNetworkStream()

Called every frame for every non-owner observer. You can receive the series of data, in order, by using self.NetworkView.ReceiveStream.

OnNetworkMessage(sender: Player, message: string)

Called upon receiving a self.NetworkView.SendMessage call.

Note that the OnNetworkMessage callback is separate from the one in Main: Main receives messages from the Network.SendMessage call, while components receive their own channel messages from the self.NetworkView.SendMessage call.

PreviousMainNextGamemodes

Last updated 7 months ago