actionrpg-heartbeast/ActionRPG-HeartBeast/World/Grass.gd
2024-12-31 16:25:23 -05:00

19 lines
603 B
GDScript

extends Node2D
const GrassEffect = preload("res://Effects/GrassEffect.tscn")
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func create_grass_effect():
#var GrassEffect = load("res://Effects/GrassEffect.tscn")
var grassEffect = GrassEffect.instantiate()
# var world = get_tree().current_scene
get_parent().add_child(grassEffect)
grassEffect.global_position = global_position
func _on_Hurtbox_area_entered(_area):
create_grass_effect()
queue_free()