0 votes

Sorry in advance if anything I say here sounds dumb, since i'm an amateur to game development.
I've been trying to figure out how to make 2 different CollisionObject2Ds use the same CollisionShape2D for an enemy. The enemy will use a seperate KinematicBody2D for wall collision and physics stuff while hit detection is handled with an Area2D, both of which using different collision layers/masks, so my Area2D doesn't send off a bunch of unnecessary signals whenever it hits a wall.
I'm aware you can have 2 Nodes share Resources, but I'd also like to have both Objects use the same CollisionShape2D node so I have to make less nodes when spawning an enemy. Is this possible? I've tried checking the docs and I don't think there's any methods for attaching shapes to collision objects besides just making the shape the child of the object, which I can't do since i'm trying to have 2 different CollisionObject2Ds use the same CollisionShape2D node.

Godot version 3.3.4
in Engine by (26 points)
edited by

1 Answer

+1 vote
Best answer

Yes, you create a basic scene containing the shared items. Save this scene somewhere and then create a 'New Inherited Scene', selecting the base scene with the shared elements (here, the collision shapes).

by (418 points)
selected by
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.