Skip to main content

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

Plugin Works Perfectly but with Errors in the Console

A topic by Nathcra created 21 days ago Views: 51 Replies: 6
Viewing posts 1 to 7

This plugin is great and works exactly as you would expect it to. Unfortunately, there are some errors that keep showing up and spamming the console (which are really annoying).

Whenever there is an object currently being dragged onto the scene, this error is spammed in the console: /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs:148 - Invalid call. Nonexistent function 'get_data' in base 'Godot.Node3D'.

This is only there when the mouse is hovering over the 3d viewport. If you put your mouse away from the 3d viewport (e.g. on the filesystem) the errors will stop coming.

This isn't a problem with anything else in Godot so it most likely isn't something about my mono / .net installation. I am running the plugin on my Linux computer (Debian 12).
How can I fix this?

Developer

Hello Nathcra,

thanks for the detailed bug report. Before I start looking into it, would you please let me know the Godot version and AssetPlacer version you are using?

Best,

CookieBadger

Thank you for responding!

I'm on Godot 4.3 mono and I am using AssetPlacer 1.4.0.

Like I said I'm on Linux but I don't think that would really change anything since it's running universal C# code. This bug seems to happen on both the official executable that you download from the Godot website and the Flathub version. 

I hope this helps.

I found another bug: when you click somewhere in the 3d viewport with nothing selected when you are either on the asset placer tab or on something else like output, it gives this error:

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

     at AssetPlacer.SurfacePlacementController.OnSelectionChanged() in [PROJECTPATH]addons/assetplacer/placementController/SurfacePlacementController.cs:line 63

     at AssetPlacer.AssetPlacerPlugin.OnSelectionChanged() in [PROJECTPATH]/addons/assetplacer/AssetPlacerPlugin.cs:line 464

     at Godot.Callable.<From>g__Trampoline|1_0(Object delegateObj, NativeVariantPtrArgs args, godot_variant& ret) in /run/build/godot-tools/modules/mono/glue/GodotSharp/GodotSharp/Core/Callable.generics.cs:line 39

     at Godot.DelegateUtils.InvokeWithVariantArgs(IntPtr delegateGCHandle, Void* trampoline, godot_variant** args, Int32 argc, godot_variant* outRet) in /run/build/godot-tools/modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs:line 86

Once again, none of these bugs actually change the plugin functionality which is great. They just appear in the console which is tedious to always see.
Developer (1 edit)

Dear Nathcra,

I've been able to investigate your issues a little. As for the first issue, I gathered that you are probably using the Terrain3D addon and placing on it? If my guess is correct, you are using an outdated version of Terrain3D (0.9.2 or prior). If you were to use Terrain3D 0.9.3 the error would not appear. If updating Terrain3D is not possible in your project, you can easily fix the error spam by going into addons\assetplacer\placementController\Terrain3DPlacementController.cs and replacing lines 30-47 with the code below:

var data = _terrain3DNode.Get("storage"); // legacy (<0.9.3)
if (data.Obj == null)
{
   return new PlacementInfo(PlacementPositionInfo.invalidInfo, "Error retrieving Terrain3D data", Colors.Red);
}
var heightRange = data.As<Resource>().Get("height_range"); // legacy (<0.9.3)
if (heightRange.Obj == null)
{
   return new PlacementInfo(PlacementPositionInfo.invalidInfo, "Error retrieving Terrain3D height range", Colors.Red);
}

As for the second error you found, I can not provide a quick fix, unfortunately. I suspect that deactivating and activating the plugin would temporarily make it disappear. If you are using any other plugins (which could be conflicting) or if the error always pops up after you perform a certain action prior to the viewport clicking you describe above, let me know. If you find any other bugs, I'm glad if you share them as well.

I hope this helps!

~CookieBadger

Hello, Cookie Badger!

Thank you so much for all the help. You were correct about me using Terrain 3D. I was able to update my Terrain 3D version to the latest (0.9.3). As for the other error, it seemed to just magically go away, as do most random bugs in software development. 

This plugin is really good and I'm already using it a lot to design levels. Thank you very much for making it :)

- Nathcra

Developer

Glad I could help!