wiserim / phaser-raycaster

Raycasting plugin for Phaser 3. Documentation:

Home Page:https://wiserim.github.io/phaser-raycaster/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When calling ray.overlap(), I receive an error this.testOverlap is not a function because its undefined.

awweather opened this issue · comments

Describe the bug
When calling ray.overlap(), I receive an error this.testOverlap is not a function because its undefined.

To Reproduce
From #7 in the documentation, I have this code

`this.ray.autoSlice = true;

this.ray.enablePhysics();

this.ray.setCollisionRange(200);

this.ray.castCircle();

let visibleObjects = this.ray.overlap();
`
However, when this.ray.overlap() is called, I receive the error above.

Is there any additional setup required to use overlap?

Thank you for a bug report.
I've located the problem and fix should be ready tomorrow.

I just pulled phaser-raycaster via NPM and I am still getting this error.

Line 71 of overlap.js still shows if(this.testOverlap(hitbox)).

I changed my package.json file from depending on
"phaser-raycaster": "^0.10.2"
to
"phaser-raycaster": "wiserim/phaser-raycaster"
and now it works fine.

Is it possible that the NPM version 0.10.2 is not actually up to date?

Thank you for information.
I've checked version available via NPM.
For some reason it's providing version 0.10.1 as 0.10.2.
I'm planning to publish updated version with minor changes this weekend. After this NPM version should be up to date.

I've published version 0.10.3.

Thank you! I just tested it and it works perfectly. I'm also excited about the other improvements you've made!