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

TypeError: ArrayUtils.GetFirstElement is not a function #4244

Closed
miran248 opened this issue Dec 18, 2018 · 1 comment
Closed

TypeError: ArrayUtils.GetFirstElement is not a function #4244

miran248 opened this issue Dec 18, 2018 · 1 comment

Comments

@miran248
Copy link

miran248 commented Dec 18, 2018

Version

  • Phaser Version: v3.15.1-FB (WebGL | Web Audio) (default build)
  • Operating system: macos v10.14.1
  • Browser: chromium v70.0.3535.0

Description

I've been using Group class as a pool of alive / dead objects but since i'm using multiple cameras in one scene I thought the Container might be a better choice, so I've tried it - replaced getFirstDead with getFirst("active", false) and got the following error:

Uncaught TypeError: ArrayUtils.GetFirstElement is not a function
    at Container.getFirst (Container.js:613)
    ...

It looks like GetFirstElementhas been renamed to GetFirst.
Did a search on the repo and found only two occurrences but not the source.

Example Test Code

The following crashes:

const c = new Phaser.GameObjects.Container(scene);
...
c.getFirst("active", false); // throws an error

The following works: (taken from Container#getFirst)

Phaser.Utils.Array.GetFirst(c.list, "active", false);

Additional Information

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants