Need a working example of a Segment Collision Shape 2D

Godot Version

Godot version 4.2.1


Anyone have a working example of instantiating a static object with a collision shape 2D (set to segment)? The docs talk about two vectors, a and b, equating to the positions of the two endpoints but I haven’t found a reference to them that works.

var static_body :=

var collision_shape :=
collision_shape.shape =
collision_shape.shape.a = Vector2(42, 42)
collision_shape.shape.b = Vector2(1337, 1337)
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.