Skip to content

Rengy Script · Base

Body

Write : Body after the name to get the hooks below as well as every script's own.

rgs
component Example : Body {
    fn on_create() {
    }
}
On this page

Its own hooks fire only on a node that carries a CharacterBody. Without one, they are declared and never run.

Hooks

fn on_create() every base

Runs once, on the first step the node exists.

fn on_destroy() every base

Runs once, as destroy or destroy_self removes the node. Nodes under it go with it without hearing it.

fn on_position_change(old_position: Vec2, new_position: Vec2) every base

Runs when the node moves in the world.

fn on_visibility_change(is_visible: bool) every base

Runs when the node is shown or hidden.

fn on_signal() every base

Runs on a step when a signal has reached this node; read it with heard.

fn loop(dt: f32) every base

Runs every simulation step while the node exists.

fn on_land()

Runs when the character body touches the ground.

fn on_leave_ground()

Runs when the character body leaves the ground.

fn on_hit_wall()

Runs when the character body is stopped moving sideways.

fn on_hit_ceiling()

Runs when the character body is stopped moving up.