Back to Filament

destroyEntity

docs/android/dokka/filament-android/com.google.android.filament/-engine/destroy-entity.md

1.75.0932 B
Original Source

//filament-android/com.google.android.filament/Engine/destroyEntity

destroyEntity

[main]
open fun destroyEntity(entity: Int)

Destroys all Filament-known components from this entity.

This method destroys Filament components only, not the entity itself. To destroy the entity use EntityManager#destroy. It is recommended to destroy components individually before destroying their entity, this gives more control as to when the destruction really happens. Otherwise, orphaned components are garbage collected, which can happen at a later time. Even when component are garbage collected, the destruction of their entity terminates their participation immediately.

Parameters

main

entitythe entity to destroy