Components
A Component adds data and behavior to an Entity.
Examples
CameraComponentLightComponentRenderComponentRigidBodyComponent&CollisionComponentScriptComponent
tip
Only add components you actually need, and remove unused ones to keep Entities lean.
Adding a Component in code
entity.addComponent('camera', {
nearClip: 1,
farClip: 100,
fov: 55
});
See addComponent.
Accessing a Component
const camera = entity.camera;
Removing a Component
entity.removeComponent('camera');
See removeComponent.
Enabling / Disabling Components
entity.model.enabled = false;
See enabled.
tip
If a component is temporarily not needed, consider disabling it instead of removing it.