How do I change a rectangleshape2D`s extent in code?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dragon20C

Heres a picture of the code with the error

i need to create collision shapes on the fly, but I first need to set its extents but I am greeted with this error im not sure why im getting it, is it to do where I put it, I don’t know.

:bust_in_silhouette: Reply From: Dragon20C

okay I figured it out, I needed to set RectangleShape2D as new as well