Get Component when Collider trigger
Cocos
APRIL 9, 2025
I want get component Planet when Player Contact but its not work ContactPlanet(){ if(this.collider){ this.collider.on(Contact2DType.BEGIN_CONTACT,this.onBeginContactPlanet, this); this.collider.on(Contact2DType.END_CONTACT,this.onEndContactPlanet, this); } } onBeginContactPlanet(contact: any, selfCollider: CircleCollider2D, otherCollider: CircleCollider2D){ console.log(" va chm"); this.isPlanet = true; this.GetComponentPlanet(otherCollider); } onEndContactPlanet(contact: any, selfCollider: Circl
52
52
Let's personalize your content