+1 vote

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:
enter image description here

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 :( )
3. Edge Editor like Unity?

Please help :)
Math

in Engine by (40 points)

1 Answer

0 votes

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)

by (27,784 points)

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!

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.