Auto Generate Sprite3D colliders (or better alternative)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MathieuJazz
:warning: Old Version Published before Godot 3 was released.

Hi awesome community!

I designed a map that only have the ‘Overlay’ of the level and I’m using it as Sprite3D (It needed to be 3D)

Overlay:

I started by applying CollisionShapes (Boxes and Planes) on edges, but it costs to much time!

I am simply trying to figure the simplest way to add colliders on the edges so my objects won’t be able to get out!

Possible ways:

  1. Importing the PNG with alpha borders? (Can’t find anything!)
  2. Dynamically create the Polygon with Position3D nodes? (Can’t find exemples :frowning: )
  3. Edge Editor like Unity?

Please help :slight_smile:
Math

:bust_in_silhouette: Reply From: Zylann

So you want to be able to design your whole level as a giant texture? Why are you using 3D?

In 2D, the solution is simple, use a StaticBody with a CollisionPolygon, and the editor will let you edit the polygon to trace the borders of your level directly over it. There are ways to code it to make it automatic, but you need to write this yourself, more headscratching.

Doing this in 3D is less straightforward if you want to use a texture. Instead, the 3D engine expects collision meshes, so it’s easier to design this mesh into a 3D editor such as Blender for example, because you can then import it and generate the collider from it.

If you manage to generate the outlines with a script tough, you can also generate this mesh collider from code (but still needs headscratching :p)

I will try it with blender… The reason why I made my game 3D is because I will actually use Depth (z) a lot.

Thanks for the idea!

MathieuJazz | 2017-09-07 19:19