Fortune
Fortune

Reputation: 181

Adding items from a player to the tilemap godot

I am trying to drop items from a players inventory onto the floor. Currently, I am storing items as kinematicBody2Ds, this will likely change, but I would like to create a node on the map via GDScript.

Is it possible to create items from already created TSCN files in this process to avoid redundancy?

Upvotes: 0

Views: 513

Answers (1)

Fortune
Fortune

Reputation: 181

You can create instances from the TSCN files, using the load/preload methods.

var node = load("res://pathToFile.tscn").instance()

From there I could change settings of the node and create a new instance of the object.

Upvotes: 0

Related Questions