How to create a line and add collision to it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By jabber bin kibria

Hello!
I’m new to Godot. I want to create a clone of the following game. How can I create a line when I press my mouse button at the mouse pointer position and add collision to the line so a ball or player can jump into it?

Here is the game video made with Pygame by Dafluppypotato
Thank you.

I’m not that experienced with collision and stuff but you could probably use a StaticBody2D with a line or segment collision shape.

Yuu | 2022-03-01 20:16

I made a game where the player can draw a “paddle” to play something like Pong. Have a look at the source code.

Ertain | 2022-03-02 09:51