Hi, I’m using Creator 3.8.5 & handling 2d collision - to get direction of 2 objects when they collide
My physics engine is 'Box2D based 2D physics system"
I followed this article
and my code goes here
ballColliderComp.on(Contact2DType.BEGIN_CONTACT, (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) => {
const normal = contact.getWorldManifold().normal;
log(`normal = `, normal);
const points = contact.getWorldManifold().points;
log(`points = `, points);
});
But normal always return null & points always return an empty array []
Could anyone please tell me if I did something wrong?
Thanks!