Skip to content
This repository was archived by the owner on Jun 29, 2024. It is now read-only.
This repository was archived by the owner on Jun 29, 2024. It is now read-only.

CapsuleShape2D causing weird Interaction with intersect_ray and StaticBody2D  #106

@markweenwork

Description

@markweenwork

CapsuleShape2D collision shape (when height to radius ratio is above 2:1) is some how affecting intersect_ray (that intersects 2 non overlapping StaticBody2D objects) queries on 2 StaticBody2Ds - When the Capsule collides with one of the StaticBody2D objects the intersect_ray seems to ignore one of the StaticBody2D objects even though the ray hits it and it is the closer intersection

sample scene provoided

TO REPRODUCE

  1. open sample scene
  2. play the scene
  3. there is a script on the root node that casts an instersect_ray (represented as a green line) through two non overlapping StaticBody2D objects - it turns the color of the object it hits to red (both objects are reset to white in the _physics_process func)
  4. a RigidBody2D object with a CapsuleShape2D (with height to radius ratio of above 2:1) drops and lands on one of the StaticBody2D objects - this seems to affect the intersect_ray as it changes which object the intersect_ray now collides with
  5. if you change RigidBody2D->CollisionShape2D->Shape->Height to 40.0px this bug no longer happens

EXPECTED BEHAVIOUR

Unless I am doing something wrong or missing something - the interaction between the CapsuleShape2D and the StaticBody2D should in this case not have any effect on the intersect_ray result

VERSIONS

  • OS: Linux Debian 11
  • Godot v4.2.1
  • Box2d 0.9.9 and 0.9.11

RayIntersectBugBox2D.zip

Capsule2Dbug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions