2D Element collision


#1

Hello, I want my 2D element to be colliding with other element. However it seems like they don’t collide with each other somehow… Would appreciate any help.

var BicyclePart = pc.createScript('bicyclePart');

// initialize code called once per entity
BicyclePart.prototype.initialize = function() {
    this.entity.collision.on('contact', this.onTriggerEnter, this);
    
    this.isGrab = false;
};

BicyclePart.prototype.onTriggerEnter = function(entity)
{
    console.log("Hit" + entity.name);
    //this.app.fire("CheckPart");
};

s


#2


read that
i think u have to use their plugin to have 2d physics 3ds physics are different and i dont think work with 2d elements


#3

Hey koala, thanks for the reply. Someone suggested that I should use AABB detection for it and I did it.

Thanks for your suggestion. :slight_smile:


#4

k glad it worked out :smile: