15 lines
291 B
GDScript
15 lines
291 B
GDScript
extends Node3D
|
|
class_name ItemSpawner
|
|
|
|
@export var identifier: String
|
|
@export var spawnedItem: PackedScene
|
|
|
|
func spawnItem() -> Node:
|
|
if spawnedItem:
|
|
var obj = spawnedItem.instantiate()
|
|
self.add_child(obj)
|
|
#obj.position = position
|
|
#obj.rotation = rotation
|
|
return obj
|
|
return null
|