Unblocked!


Ran into an annoying InvalidCastException recently – turned out that I had changed the type of a node from Node2D to Camera2D but without updating the attached script from 

public partial class CameraMovement : Node2D

to

public partial class CameraMovement : Camera2D

This meant that when I would "get" this object, either by direct reference, or a helper method like GetViewport().GetCamera2D, it would fail the cast and spam an exception every frame.

It took me a while to spot it, partly because I'm working on this project so sporadically so I had completely forgotten the node type change, but it was a quick fix at least!

New build runs as expected, at last! Feel much better being unblocked.

Files

The Bacon Game 123 MB
Version 0.2.3 Jan 18, 2024
The Bacon Game 72 MB
Version 0.2.3 Jan 18, 2024

Get The Bacon Game

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.