0 votes


Short Question:
How can I use a Export (NodePath) var to select via Inspector a Node external to the scene?

Longer Question:
I want to create a basic script to create a instance of a explosion every time the Health of a enemy reach zero. The explosion is a scene itself and I want to instantiate a different scene for different enemies.

So I though that a export variable could be useful for that, but it only let me choose a Node inside the actual scene, I cannot get a external scene or node.

There is a way to do that without need to hardcode the path for every script?

asked Mar 19, 2019 in Engine by shinspiegel (21 points)

1 Answer

+1 vote
Best answer

I've found how to do that.
To link to another scene, I should use export (PackedScene) var, instead of export (NodePath) var.

Sorry for this post.

answered Mar 19, 2019 by shinspiegel (21 points)
selected Mar 31, 2019 by shinspiegel

At least you shared the answer with us. :P

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.