How to have Bounding Box collision between 2 sprites in Flappy Bird game

I want to have collision between Bird and downpole using Bounding Box method .I have written following code But it didn’t work.In this game movement for pole is written inside movePole.js script and it is attached to “FirstPolesSet”. I have attached my entity hierarchy as well as the code written for Bounding Box as a screenshot. Here Bounding Box collision script is attached to Game entity

I would check that the size of the bounding boxes and also try to see if you can reproduce it in a new, simple project of just boxes and see if there are any issues there.

is it by using following code

var BirdBBox = new pc.BoundingBox(this.BirdEntity.getPosition());
var BirdSize = this.BirdEntity.sprite.width;
var BirdActualSize = BirdSize * this.BirdEntity.getLocalScale().x;
BirdBBox.halfExtents.x += BirdActualSize / 2;

this.DownPoleBBox = new pc.BoundingBox(this.downpoleEntity.getPosition());
thisDownPoleSize = this.downpoleEntity.sprite.width;
this.downpoleActualSize = this.DownPoleSize * this.downpoleEntity.getLocalScale().x; //width 2.5

this.DownPoleBBox.halfExtents.x += this.downpoleActualSize / 2;

At this point, I would suggest debugging and looking at the values being set. Limit it to one pipe and bird to see where the values may be incorrect here.

BoundingBox has getMin and getMax to help see where the World Position of the corners of the boxes are


.

After collision
Bird Y Min -2.0110394954681396
DownPole Y Max -2.006857395172119

Here collision is happening at only one point

I would limit the game to only one pipe so it’s a lot easier to debug for you. If you are still having issues, I would post the project here for someone to look at