+2 votes

So I got this NPC node and so far I've exported three script variables: Id, Act_type, and sequence.

enter image description here

Here's a bit of his code:

enter image description here

But I want to make the NPC a tool so that I can program in the ability to change his sprite in the editor with a new script variable, so I make him a tool through the code

enter image description here

But when I reload the program and check the NPC in the editor, the script variables are gone.

enter image description here

I need to have my NPC node to have script variables and also be a tool. What can I do? I don't know what's wrong.

in Engine by (33 points)

So I figured out what the problem was. A script that this node inherited from was using an obsolete(?) get_pos() function and when tools have problems like that in the script, they probably won't function as tools and they definitely won't display their script variables.

Please log in or register to answer this question.

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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.