0 votes

I am currently developing a small 2d space game for learning godot.
I want to have "modular" ships, meaning a ship has a hull, an engine, cannons, etc. each being a scene.
A ship could be set up like this

|- Hull
|- Engine

Now I am stuck with the following problem. I set up the Ship node as KinematicBody2D as I use that node for movement.
BUT the collision should come from the sub scenes (Hull, Engine, etc.).
So I made them KinematicBodies too and added the CollisionShapes.

However this does not work, as the Ship needs a CollisionShape child (KinematicBody2D) and it being in the nested Scenes (Hull, Engine, etc.) does not suffice. In addition if I move the Ship node with moveandcollide/_slide the child nodes do not collide.

I do not think that my current approach is correct.
What can I do to accomplish this without breaking my modularity by moving the children collisions to the Ship?

in Engine by (12 points)

Please log in or register to answer this question.

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 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 webmaster@godotengine.org with your username.