-
-
Notifications
You must be signed in to change notification settings - Fork 21k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bullet] RayCast.get_collider_shape() doesn't actually return Shape ID #37985
Comments
This should either be clarified in the documentation ( It might be worth making things consistent with KinematicCollision's API:
While noting that in 2D there's also:
which I think returns a shape index, but I didn't check. |
@pouleyKetchoupp I want to report that there's still an issue in Godot 3.3.3 with spaceState.IntersectRay's way of raycasting, the "shape" key doesn't return the correct id with Bullet (the raycast node counterpart seems to not have this problem though). |
@JakSparro98 Indeed, the issue actually still exists for raycasts. It was reported again in #47989 with a minimal test project so I'll leave that one open. |
Godot_v3.2-stable_win64
Windows 10 version 1809
The documentation states that RayCast.get_collider.shape() returns the Shape ID of the CollisionShape that the RayCast intersected. However, it doesn't seem to return the correct number.
var target = $RayCast.get_collider()
var shape = target.shape_owner_get_owner(target.shape_find_owner($RayCast.get_collider_shape()))
The above code in my project causes this error:
E 0:00:06.707 shape_find_owner: Index p_shape_index = 522 is out of bounds (total_subshapes = 1).
<C++ Source> scene/3d/collision_object.cpp:328 @ shape_find_owner()
Bullet.gd:54 @ _process()
After asking for help in the Godot Discord Server, a Godot dev suggested that get_collider_shape() was returning the Shape RID instead. They suggested I check by using Godot Physics Engine, which after testing caused no errors
The text was updated successfully, but these errors were encountered: