article thumbnail

Rechecking for a collision

Cocos

B grows and is now of size 2, and is still touching A - however, this won’t trigger a new collision event. I am aware I can just listen to the collision stay event, however that seems pretty inefficient as I only need to check again after the size changes… Is there any other, more efficient way to do that?

article thumbnail

Collision detection & Collision ignore

Cocos

can anyone tell me how to detect collision in cocos creator and how I can ignore the collision between two rigid bodies? kindly describe with an example. thanks in advance I am using version 3.7.2.

Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Collision detection & Collision ignore

Cocos

Go to Project Settings → Physics → Collision Matrix There, you can create groups and assign which group interact/ignore with which group. Then, in your node’s collider, assign the desired group for it. I’d suggest you to please read documentation and tutorials first and read them alot. Just my two cents and enjoy coding!

article thumbnail

Destoying from scene shows all children deleted, but still childrens are visible in scene on collision. on colllision

Cocos

Destoying from scene shows all children deleted, but still childrens are visible in scene on collision : - On collision with the saw, this is happening : - onLoad() { this.animationComponent = this.node.getComponent(Animation); this.animationComponent.clips[0].name What’s happening wrong with the collision detection code?

article thumbnail

Physics Collision with non dynamic types

Cocos

I’ve tried changing the type (static/kinematic/animated) of the other objects, but collision detection still doesn’t work. The only time collision is detected is when I set the “Character” object’s Rigidbody2D type to “dynamic”. However, this causes the “Character” object to be affected by gravity, which I don’t want. normalize().multiplyScalar(this.speed);

article thumbnail

Physics Collision with non dynamic types

Cocos

I’ve tried changing the type (static/kinematic/animated) of the other objects, but collision detection still doesn’t work. The only time collision is detected is when I set the “Character” object’s Rigidbody2D type to. However, the “Character” object doesn’t collide with other objects that have a Rigidbody2D and a Collider2D attached.

article thumbnail

Physics Collision with non dynamic types

Cocos

I’ve tried changing the type (static/kinematic/animated) of the other objects, but collision detection still doesn’t work. The only time collision is detected is when I set the “Character” object’s Rigidbody2D type to. However, the “Character” object doesn’t collide with other objects that have a Rigidbody2D and a Collider2D attached.