Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Really good Addon, few bugs in the console

A topic by berni94 created Mar 10, 2025 Views: 307 Replies: 9
Viewing posts 1 to 8

Godot 4.4 mono AssetPlacer 1.4

I'm really liking your plugin, is really well made, but I'm encountering some bugs in the Godot's Console: 

ERROR: /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs:113 - System.NullReferenceException: Object reference not set to an instance of an object.

  ERROR:    at AssetPlacer.SurfacePlacementController.OnActiveChanged() in G:\Godot Project\DarkShooter\addons\assetplacer\placementController\SurfacePlacementController.cs:line 102

  ERROR:    at AssetPlacer.AssetPlacementController.set_Active(Boolean value) in G:\Godot Project\DarkShooter\addons\assetplacer\placementController\AssetPlacementController.cs:line 19

  ERROR:    at AssetPlacer.AssetPlacementController.RestoreGodotObjectData(GodotSerializationInfo info) in G:\Godot Project\DarkShooter\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSerializationGenerator\AssetPlacer.AssetPlacementController_ScriptSerialization.generated.cs:line 26

  ERROR:    at AssetPlacer.SurfacePlacementController.RestoreGodotObjectData(GodotSerializationInfo info) in G:\Godot Project\DarkShooter\.godot\mono\temp\obj\Debug\Godot.SourceGenerators\Godot.SourceGenerators.ScriptSerializationGenerator\AssetPlacer.SurfacePlacementController_ScriptSerialization.generated.cs:line 20

  ERROR:    at Godot.Bridge.CSharpInstanceBridge.DeserializeState(IntPtr godotObjectGCHandle, godot_dictionary* propertiesState, godot_dictionary* signalEventsState) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 255


It seems that Godot is working properly, but these are annoying to see everytime. Are there any known fix?

Developer

Hello berni94,

I'm glad you like the plugin. Thanks for the report, I am looking into this now. I have not been able to reproduce it for now, but it seems to happen during (de)serialization, i.e. when the plugin is loaded or unloaded. You might be able to get rid of the error if you disable and re-enable the plugin. If that doesn't fix it, restarting the editor might also fix it. 

Unfortunately, it is quite difficult to prevent this type of error during serialization, so I would need some more info to find a potential fix for this. When, and how often does this error occur in your project? E.g. does it happen after you rebuild your C# solution, or right after enabling the plugin? Also, how severe is this issue for your workflow?

I'd appreciate if you could update me on these details.

Well it does happen everytime i move/click in the viewport, it does not cause any damage but it is really annoying to see the red lines on the terminal. 

Developer

Does disabling and re-enabling (temporarily) remove the error? 

Which OS and which .NET version version are you on?

(1 edit)

Yes the error continues even after disabling the addon.

Latest version Windows 11 and .Net Version 9.0.3

Developer

Are you using any other plugins that could cause an incompatibility? 

Dont think so, I'm currently using Blender 3D Shortcuts, AssetPlacer and IDE Script

Developer

Apologies for this very late response. I have been looking into this from time to time again,  but still have not found a reliable way to reproduce the issue. So far, it seems like the engine arbitrarily performs a (de)serialization and then the plugin looses certain references.

If you could somehow provide me with exact steps to do in order to get this issue, it might help me find a fix. I would also be interested in your hardware (especially CPU and RAM) to see if the bug is related to limitations in physical resources.

So far, one thing you could try is go to the file addons\assetplacer\placementController\SurfacePlacementController.cs and in line 102 change `editorInterface` to `EditorInterface.Singleton`. If this fixes the issue, please also let me know, so I can include it in a hotfix. 

In the meantime, I will keep trying to find a fix, whenever I have the time.

So far, replacing that reference to the EditorInterface (and all others) with the new singleton has removed this error from our usage. Will continue to test on 1.4.1.

Developer

thanks for the info. While it's more a workaround than a fix, I'm glad it prevents the problem. I might decide to break compatibility with 4.0 and remove all those deprecated references in an update then.