The Godot Community Forums are back up and running! Please read the the announcement post for important information on what happened. Thanks!

[C#] Acces Extends property of a collision shape2D

Hey Guys,
I want to use the extends property of a collision shape2D for the position of a raycast2D. I tried several options from the docu but didn't get to work. How to do this? Is this possible in C# like in GDScript? Or ist this a bug?

Best regards


  • TwistedTwiglegTwistedTwigleg Posts: 3,136Admin

    This discussion was caught in the moderation queue since you have not confirmed your account yet.

    Upon creating your account you should have received an account verification email. The confirmation email may have been incorrectly flagged as spam, so please also check your spam filter. Without confirming your account, future posts may also be caught in the moderation queue. You can resend a confirmation email when you log into your account if you cannot find the first verification email.

    If you need any help, please let us know! You can find ways to contact forum staff on the Contact page. Thanks! :smile:

  • Okay, account is confirmed :)

    Best regards.

  • No one has a clue?

  • boruokboruok Posts: 18Member
    edited September 13

    @slime91 said:
    No one has a clue?

    CollisionShape2D collision = (CollisionShape2D)GetNode("CollisionShape2D");
    RectangleShape2D rectangle= (RectangleShape2D)collision.Shape;
    // do something with rectangle

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file