Hi, I'm making a tower defense game and I was trying to figure out a way to form an Area3D around a Path3d that I use for enemies to prevent towers from being placed in the enemies' path. So far the only thing I've found is this video
but it only uses CSG Polygons. Unless there is a way to copy a collision polygon's shape I don't know how to form a collision shape for an area around a path. Any ideas?
Is there a way to generate a collision shape around a path?
Asked Answered
Sagittal Unless there is a way to copy a collision polygon's shape
You can do that. For example, a CollisionShape3D's shape property is a Shape3D. If the Shape3D is a ConvexPolygonShape3D, then its points property is a PackedVector3Array containing the polygon vertices.
Turnout that works, but the only issue is that it is registered as a body and not as an area, I'd rather have it be considered an area for multiple reasons.
Understandable. Given the engine can create the shape, and a reference to the mesh, is it possible to copy/assign the shape to an area and later disable the body?
The use of layers/masks to remove interactions due to collisions might also help.
© 2022 - 2024 — McMap. All rights reserved.