Friday, November 18, 2022
HomeGame DevelopmentTips on how to get polygon collider worldpoints in cocos creator 2.4.10...

Tips on how to get polygon collider worldpoints in cocos creator 2.4.10 – Cocos Creator


Hello all, When you’ve got already used Intersection2D for collision detection utilizing polygon collider in cocos creator 3. x model. You’d know concerning the ‘WorldPoints’ methodology which converts all of the polygon factors w.r.t world coordinates. Proper now I’m engaged on cocos creator 2.4.10 and I wish to Implement collision detection utilizing a polygon collider. I might use the Intersection methodology. In contrast to the three. x model there is no such thing as a such methodology to transform the polygon factors to world coordinates. Has anybody labored on the polygon collider within the 2. x model? Can anybody assist me with this? Thanks upfront.


do this in 2.4 model

if (cc.Intersection.pointInPolygon(touchLocation, this.colliderComponent.world.factors)) {
            console.log("Collision Success");
        }

Thanks for the reply. I’m attempting to detect collision between two objects (Intersection.PolygonPolygon). This works when Involving a contact occasion on a collider object.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments