You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A node is lost when a script is assigned to it with "SetScript ()".
References to that node will not be valid.
Normally the run window closes immediately when it appears and nothing else happens, however sometimes the editor shows this error:
If line 13 is commented out, then no error occurs.
On the other hand, if line 13 is commented, it can be seen in remote mode that the "script" property is displayed duplicated.
Steps to reproduce:
Create a class without code.
Create a node, for example of type Node.
Create a script and in _Ready create a new node type object.
Then assign it the initial script that had no code.
Call "SetProcess (true)" of the newly created node.
Run.
The run window will close automatically at startup, but may occasionally the editor shows the initial image error.
Test project code, line 13 causes the error:
The text was updated successfully, but these errors were encountered:
Torguen
changed the title
"SetProcess( true )" does not work with a node that has been assigned a script.
Any reference to a node that was script-assigned with SetScript (), is invalid
Jan 31, 2021
Torguen
changed the title
Any reference to a node that was script-assigned with SetScript (), is invalid
Any reference to a node that was script assigned with SetScript (), is invalid
Jan 31, 2021
The ObjectDisposedException is expected behavior. When you call SetScript on nodo, nodo isn't valid anymore. See #31994 (comment) for more details, and a way to get a reference to the new node that Godot creates when you call SetScript.
However, in most cases you don't actually need SetScript, anyway. It looks like you can just call new ScriptSetted(), which is a lot simpler:
Godot version:
3.2.4 rc1 mono
OS/device including version:
win10 64
Issue description:
A node is lost when a script is assigned to it with "SetScript ()".
References to that node will not be valid.
Normally the run window closes immediately when it appears and nothing else happens, however sometimes the editor shows this error:
If line 13 is commented out, then no error occurs.
On the other hand, if line 13 is commented, it can be seen in remote mode that the "script" property is displayed duplicated.
Steps to reproduce:
Create a class without code.
Create a node, for example of type Node.
Create a script and in _Ready create a new node type object.
Then assign it the initial script that had no code.
Call "SetProcess (true)" of the newly created node.
Run.
The run window will close automatically at startup, but may occasionally the editor shows the initial image error.
Test project code, line 13 causes the error:
Minimal reproduction project:
TestSetScript.zip
The text was updated successfully, but these errors were encountered: