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. Just my two cents and enjoy coding! Just my two cents and enjoy coding! Then, in your node’s collider, assign the desired group for it.

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?

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

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”. This is the line of code I’m using to move the Character. const movement = new Vec2(x,y).normalize().multiplyScalar(this.speed);

article thumbnail

Nearing the Finish Line: Rewriting the Untold Engine

Harold Serrano

After months of coding, tweaking, and testing, I’m thrilled to share that the rewrite is almost done. This modular approach keeps everything clean and efficient, allowing developers to focus on their game logic instead of wrestling with tangled code. Want collision? Want to add physics? setEntityKinetics(). setEntityCollision().

Engine 69
article thumbnail

Handle the collision of sprites

Cocos

I’m trying to handle the collision of two sprites, i added BoxCollider2D to the sprites. code for the "character ". code for the “key”. code for the "character ". code for the “key”. code for the "character ". code for the “key”. start () {. this.collider.on(Contact2DType.BEGIN_CONTACT, destroyKey(){.

article thumbnail

Best Practices for Sharing Code Between Cocos Creator 3 Projects

Cocos

Best Practices for Sharing Code Between Cocos Creator Projects Hello fellow developers, I’m currently exploring efficient ways to share reusable code across different projects in Cocos Creator and would appreciate your insights on two methods I’m considering: Git submodules and NPM packages. Has anyone else faced similar challenges?

Code 40
article thumbnail

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

Cocos

Thanks for replying, Actually i got the error, Its because of the the below code only. Thing happening was it was removing 2 nodes at a time, but only destoying 1 node at a time.