This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I'm working on a asteroids clone and encountered a strange issue, the asteroid cannot detect if the area entered is the ship or not

I have attached a minimal version of the game, please look through it, any help is greatly appreciated

https://drive.google.com/file/d/1uOjJt7KSlC4OMRpRJsjk-azEYPTQ6MoK/view?usp=sharing

Godot version Godot_v3.4.2-stable_win64
in Engine by (63 points)

1 Answer

0 votes
Best answer

Hello! I took a look at the ship and the asteroid's scenes. In the asteroid script, you check if the collided area is in the "ship" group (which is correct), but the ship scene does not have any groups set.

If you go to the root of the ship scene, and click on the "Node" tab on the top right corner, and assign the ship group to it, does the asteroid collision work? Remember that the name of the group must be exactly the same name you are checking on the asteroid script.

Hope this helps!

by (56 points)
selected by

thanks, for some reason I was confusing collision layers with groups :P

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.