Line Collider 2D

Line Collider 2D is a Godot Engine script that dynamically generates collision shapes from an array of Line2D nodes. This tool simplifies the creation of collision boundaries for prototypes and games by automatically creating a collision shape chain that follows the provided lines.

https://github.com/Kylogias/godot-line-collider-2d

Line Collider 2D: Dynamic Collision Shapes from Line2D

Line Collider 2D is a Godot Engine script designed to streamline the process of creating collision shapes based on Line2D nodes. This is particularly useful for prototyping game levels or creating dynamic collision boundaries. The script takes an array of Line2D nodes as input and generates a corresponding collision shape chain that accurately follows the lines.

How to Use

  1. Place the script anywhere within your Godot project.
  2. Attach the script to the physics bodies you want to have line-based collisions.
  3. Create Line2D nodes in your scene (they don't need to be visible).
  4. Use the built-in line tools to modify the shape of the lines.
  5. In the Inspector panel, expand the list of exported variables to match the number of Line2D nodes you want to use for collisions.
  6. Assign the node path of each Line2D node to the corresponding slot in the exported variables list.

Key Features

  • Dynamic Collision Generation: Automatically creates collision shapes based on Line2D nodes.
  • Easy to Use: Simple setup and integration into existing Godot projects.
  • Prototyping Friendly: Simplifies the process of creating and adjusting collision boundaries during development.

Future Improvements

  • The script currently does not support rotation and scale, which will be addressed in future updates.

Resource Details

tool

Kylogias



3