CollisionShape2D's RectangleShape2D size not updating

Godot Version

4.3

Question

I’m new to godot and updating this Asteroid tutorial to add AI to the ship so that it navigates by itself:

As part of this, I want to add a CollisionShape2D that will tracks where the asteroid would be in the next few seconds. If that CollisionShape2D overlaps the ship, then it would take evasive action.

My asteroid’s own CollisionShape2D is working fine. However the “evasion detection” CollisionShape2D which would have a RectangleShape2D is not.

This is a mockup of what I want to create, where the red rectangle indicates my “evasion detection” CollisionShape2D.

My layers look like this:
image

However even if I set my CollisionShape2D’s RectangleShape2D with a size (500,500), it still shows in debug mode as just (20 20) with the default position of (0, 0).

image

Let me know if there’s any more detail that I can provide.

Does it still show as 20,20 if you drag it out to your desired size in the scene viewer?

pic of what i mean if i didnt communicate it well

That’s another odd thing. The CollisionShape2D shows (500,500) when viewing in the 2D viewer.

Plus when I run the game and print its size, it shows (500,500)!

@pig_master Turned out to be user error. I had written code to change the CollissionShape2D’s shape and in all my testing, forgot to disable it.

Thanks for your suggestion of looking at the Scene Viewer. That helped me debug and find my user error!