Created
April 5, 2020 14:10
-
-
Save konchunas/7cfc5135625cb71aebf6544e6245bb37 to your computer and use it in GitHub Desktop.
Adds a CollisionShape to a StaticBody in GDScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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