Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component constructors get called too early #27

Closed
ayebear opened this issue Apr 8, 2018 · 0 comments
Closed

Component constructors get called too early #27

ayebear opened this issue Apr 8, 2018 · 0 comments
Assignees
Labels

Comments

@ayebear
Copy link
Owner

ayebear commented Apr 8, 2018

By using the entity object passed into the constructor, any code attempting to use entity.get('currentComponent') will always return undefined, because the constructor must complete in order for the entity to actually contain that component. This was the original reason for onCreate's existence, but was forgotten in 0.3.0. This will need to be added back and the use of the constructor should be avoided, similar to the initialize() method in systems.

@ayebear ayebear added the bug label Apr 8, 2018
@ayebear ayebear self-assigned this Apr 8, 2018
@ayebear ayebear closed this as completed in 114e554 Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant