Skip to content

Instantly share code, notes, and snippets.

@konchunas
Created April 5, 2020 14:10
Show Gist options
  • Save konchunas/7cfc5135625cb71aebf6544e6245bb37 to your computer and use it in GitHub Desktop.
Save konchunas/7cfc5135625cb71aebf6544e6245bb37 to your computer and use it in GitHub Desktop.
Adds a CollisionShape to a StaticBody in GDScript
func create_collision():
var body = StaticBody.new()
var collision = CollisionShape.new()
var shape = CylinderShape.new()
shape.radius = 100
shape.height = 50
collision.set_shape(shape)
body.add_child(collision)
self.add_child(body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment