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

CapsuleShape2D causing weird Interaction with intersect_ray and StaticBody2D #106

Open
markweenwork opened this issue Feb 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@markweenwork
Copy link

markweenwork commented Feb 14, 2024

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

@markweenwork markweenwork added the bug Something isn't working label Feb 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant