![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | V1Ultrakill |
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.