Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Charlie |
There is get_rid()
for resources. But there is no get_rid()
for nodes (except, strangely, the single node type CollisionObject2D, which does have it). How do I get RID for any kind of instanced node?
There are many google hits making me think that get_rid()
was perhaps a valid node method in Godot 2.0. It isn’t in 3.0.x.
My specific need is to get RID for a MultiMeshInstance to set AABB. Unless someone can tell me otherwise, the only way to set AABB for a node instance (not a mesh) is using VisualServer.instance_set_custom_aabb ( RID instance, AABB aabb )
. But I need RID for the MultiMeshInstance to do so.
I did try VisualServer.mesh_set_custom_aabb()
on the MultiMesh, but that gives me an error telling me that my MultiMesh is not a Mesh (which I knew already). Setting AABB for the original Mesh used in the MultiMesh does not determine AABB of the MultiMesh or the MultiMeshInstance.
Arghhh… does anyone know how to make the Q&A forum not garble underscores?
The methods I was trying to reference above are as follows (substitute underscore for dash):
get-rid()
instance-set-custom-aabb()
mesh-set-custom-aabb()
Charlie | 2018-09-03 02:29
The need for setting AABB on an instance is stated in the docs for MultiMesh: “Since instances may have any behavior, the AABB used for visibility must be provided by the user.” Annoyingly, there are get_aabb() methods everywhere but no set_aabb() anywhere that I could use (not for MultiMesh or MultiMeshInstance or MultiMeshInstance inherited classes).
The method to do so using VisualServer is referenced here:
Need a way to set a custom AABB per visual instance · Issue #9544 · godotengine/godot · GitHub
Implement per-instance custom bounding box by Zylann · Pull Request #12645 · godotengine/godot · GitHub
However, I’m still stuck since I don’t know how to get the instance RID that I need to use in
VisualServer.instance-set-custom-aabb(RID, AABB).
Charlie | 2018-09-03 03:46