You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
355 B
17 lines
355 B
extends RigidBody2D
|
|
class_name Obstacle
|
|
|
|
@onready var original_parent = get_parent()
|
|
|
|
func grabbed(by):
|
|
$shape.disabled = true
|
|
can_sleep = true # this is needed to make the object sleep when grabbed
|
|
sleeping = true
|
|
gravity_scale = 0
|
|
reparent(by)
|
|
position.y = 0
|
|
|
|
func dropped():
|
|
$shape.disabled = false
|
|
gravity_scale = 1
|
|
reparent(original_parent)
|
|
|