You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Called once when the component is first added to a GameObject.
public
update()
Called every frame for logic updates.
public
fixedUpdate()
Called at a fixed interval for physics/timed logic.
public
onDestroy()
Called before the component is removed or the GameObject is destroyed.
public
render(Camera camera)
Called every frame for rendering-related behavior.
public
debugRender()
Called every frame after rendering for debug visuals.
public final
safeUpdate()
Runs update() safely, catching and logging exceptions.
public final
safeStart()
Runs start() safely, catching and logging exceptions.
public final
safeFixedUpdate()
Runs fixedUpdate() safely, catching and logging exceptions.
Overview
The Component class is the base for all attachable behaviors in the engine. Subclass it to create custom logic, rendering, or physics. Lifecycle methods are called by the engine automatically.
/** * Called once when the component is first added to a GameObject. */publicvoidstart()
/** * Called every frame. Use for real-time logic like movement, input, etc. */publicvoidupdate()
/** * Called at a fixed interval, typically for physics calculations. */publicvoidfixedUpdate()
/** * Called before the component is removed or the GameObject is destroyed. */publicvoidonDestroy()
/** * Called every frame for rendering-related behavior. * @param camera The camera to use for rendering */publicvoidrender(Cameracamera)
/** * Called every frame after rendering, mainly for debugging. */publicvoiddebugRender()
/** * Runs update() safely, catching and logging exceptions. */publicfinalvoidsafeUpdate()
/** * Runs start() safely, catching and logging exceptions. */publicfinalvoidsafeStart()
/** * Runs fixedUpdate() safely, catching and logging exceptions. */publicfinalvoidsafeFixedUpdate()