The Godot Community Forums are back up and running! Please read the the announcement post for important information on what happened. Thanks!

Instantiated nodes do not collide with each other

UnknownUserUnknownUser Posts: 0

I have been banging my head against a wall for hours now, so I would love to hear any ideas on how to stop...

I have a scene:
Node2D (GameSceneRoot)
...KinematicBody2D (Nest)
......Sprite
......CollisionShape2D

I have also an ant scene:
KinematicBody2D (Ant)
...Sprite
...CollisionShape2D

Nest instantiates a new Ant every second. Ants move with move_and_collide() function. It returns collisions with GameSceneRoot and Nest, but never with another Ant. Ants do not move over each other. Ants actually even push each other. So they clearly collide, but silently. All collisions and masks are at same layer.

How can I catch collision between ants?

Comments

  • cyberealitycybereality Posts: 1,053Moderator

    Not sure. Would probably have to see some of the code to understand what's happening.

  • Found the bug when I was going to post the code. Everything worked as supposed. Due typo I assigned Ant name with "GameSceneRoot". So Ants were colliding after all but name field mislead.

    Feel stupid now. Thumbs up for reply speed though!

  • cyberealitycybereality Posts: 1,053Moderator

    No problem. Glad to hear you fixed it.

    Also, welcome to the forum!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file