Destroying components?

Hey guys, I was just wondering if I can programmatically destroy entity components like the model or animation components (yes, components, not the component’s assets) by just assigning null to them or if there is any specific method of doing it, I already looked through the documentation and found no clear answer.

Edit: literally found the answer on the entity API, sorry for the inconvenience, can anyone delete this topic?

I would rather keep it to let other people have the same issue know how to do it. Was it removeComponent on the entity?

It surely was entity.removeComponent, this post will remain forever as proof of my inability to look in the proper places

1 Like

I’m a newb to PlayCanvas and Javascript, but have been online since the days of dial up BBS. I see forums like this and questions like your valuable. This thread makes at least three valuable contributions.

  1. How to destroy a component
  2. Where to find many answers
  3. Reminds people that they can often figure things out themselves.