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

Ship
|- 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?

asked Jun 16 in Engine by Swampi (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.