Godot: Mono: Base class members reset to their default values if derived class has [Tool]

Created on 11 Apr 2020  路  9Comments  路  Source: godotengine/godot

Godot version:
3.2.1.stable.mono

OS/device including version:
Windows 10

Issue description:
C# base class members reset themselves to their default values every time the project is built if the derived class has the [Tool] attribute. I have not been able to reproduce the issue in gdscript.

Steps to reproduce:

  1. Download the sample project.
  2. Set exported variables to something other than their defaults. "B" is from Base.cs and "D" is from Derived.cs.
  3. Make some changes to either Base.cs or Derived.cs (other than changing the [Tool] attribute) so that the project has to be rebuilt.
  4. Press build.
  5. Check "B." It should have reset its value.

Minimal reproduction project:
DerivedC#BugTest.zip

bug 3.2 confirmed mono

All 9 comments

I'm having the same problem but I didn't make an issue because I couldn't reproduce it reliably. It's super annoying now because I've converted a lot of scripts to C# and it's resetting (seemingly) random sets of nodes in my scenes.

For instance, if I have a wall, a couch, a vending machine, and a sink, it will sometimes decide to reset just the walls and the couch but not the others. They all derive from the same classes and all use the [Tool] functionality. Hope this gets looked at!

@Pahasz Do you think you are now able to reproduce the issue by following my instructions?

@Phischermen Yes I was able to reproduce it in the reproduction project using those exact steps.

Same here and it is super annoying. Cannot really use the Godot editor to build test levels anymore as I could when my game was still written in GDScript.

Btw. the bug is cross plattform as I am running Linux.

Any update on this?

Any update on this?

Also interested in the solution of this issue.

There is this post in the Godot Devblog. It seems that after Ignacio organizes the Godot API into namespaces and provides a .NET friendly IO API for the Godot virtual file system, he will dedicate a month to bug fixing

this is also happening on 3.2.2.stable.mono

It's been happening from 3.2.1 through 3.2.3 beta-1 for me.

Was this page helpful?
0 / 5 - 0 ratings