waynemwashuma / chaos-engine

2d game engine
https://waynemwashuma.github.io/chaos-engine/
MIT License
3 stars 0 forks source link

Component hooks can't access other components #48

Open waynemwashuma opened 3 months ago

waynemwashuma commented 3 months ago

Description :

Trying to access other components using the Registry.get()inside the component hook, no component is returned even though the components are attached to the given entity.

Cause :

The component hook is trying to access the component when the entity's mappings has not been updated thus it accesses the archetype it previously was in.

Solution :

Call the component hooks after updating the entity mappings.

Extra information:

N/A