Entity & Component Lifecycle
Component Hooks Recap
class MyComponent extends Component<null> {
create() {
// called immediately when the entity is added to the game world
}
init() {
// called before the first update() tick, which is the frame _after_
// the entity is added to the game world
}
update(dt: number) {
// called on each frame
}
onDestroy() {
// called immediately when the entity is removed from the game world
}
}Lifecycle Overview
Impact of Lifecycles on Component Access
Last updated