geotic icon indicating copy to clipboard operation
geotic copied to clipboard

remove components by type

Open ddmills opened this issue 4 years ago • 2 comments

Add ability to remove components by Class/Type:

entity.remove(Velocity);

ddmills avatar Feb 14 '21 18:02 ddmills

Getting an error on some components when trying to remove

entity.remove(Move);

Uncaught TypeError: can't convert BigInt to number

seems to be on

var subtractBit = function subtractBit(num, bit) {
  return num & ~(1n << bit);
};

mathias-belleau avatar Feb 28 '21 22:02 mathias-belleau

@mathias-belleau components must be removed by reference currently:

entity.move.destroy();

// alternate
entity.remove(entity.move);

ddmills avatar Feb 28 '21 22:02 ddmills