-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Intersect ray hit RID is different each time? #36824
Comments
I tried with GDScript and the RID is constant. Any reproduction project for this? |
Was about to make one but then I stumbled on this #35897.. |
Sooo, when you change the debug line to No idea what is the "NativeInstance" stuff, but otherwise seems like it's working correctly. |
Okay, so the bottom line is that RID comparison is not reliable and it can't be used as a key (in dictionary for example). But at least there's a way to get the ID that can be used in these situations. Thanks, I'll make a quick test in my project to see if it solves my issue. |
This is weird actually, because RID is a built-in type, so they should compare properly. It is possible that it's only C# issue, this probably requires some more testing. |
@KoBeWi Fixed in |
Fixed in 4.0. |
Godot version:
3.2.stable.mono
OS/device including version:
macOS Catalina 10.15.3/MacBook Pro
Issue description:
DirectSpaceState.IntersectRay
hit objectRID
is different each time, even if same hit body.I didn't even notice this before because I used nodes and
collider
(and itsName
) to identify the hit target but now that I've moved some of my stuff to use Servers API directly, I have no way to identify the hit target ifRID
is constantly changing.Maybe it's supposed to change? I have no idea, couldn't find any information about it. I was going to use
RID
as a dictionary key to get my data instance but this condition fails:Steps to reproduce:
Sorry for C#, I've used GDScript only few times.
Reproduction project:
issue.zip
Screenshot of RIDs (Newtonsoft JSON serializer) when ray-casting same body:
The text was updated successfully, but these errors were encountered: