level 5
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
extends RigidBody2D
|
||||
@export var hit_object:PackedScene
|
||||
@onready var collision_shape_2d = $CollisionShape2D
|
||||
|
||||
func _ready():
|
||||
collision_shape_2d.disabled = true
|
||||
|
||||
func _on_activate_body_entered(body):
|
||||
if hit_object == null:
|
||||
return
|
||||
|
||||
if body.velocity.y > 0:
|
||||
return
|
||||
|
||||
var instance = hit_object.instantiate()
|
||||
get_parent().add_child(instance)
|
||||
instance.position.x = position.x
|
||||
instance.position.y = position.y
|
||||
queue_free()
|
||||
Reference in New Issue
Block a user