How to use RID/PhysicsServer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GodotNoob999

How can you access data from an RID? eg. RID.get_position()

If not, are there any functions not currently mentioned on the documentation?

How can you “turn” an RID into an Object? (I know you can do RID(Object))

(This is for 2D)

:bust_in_silhouette: Reply From: funabab

RID is a unique identifier used in identifying resources. This are used with low level servers e.g PhysicServer, VisualServer in performing an operations. E.g

PhysicServer.area_set_ray_pickable(area_node.get_rid(), true)

in most cases you won’t need to go this route of using low level servers in performing operations cause godot provide functions for most operations

area_node.set_ray_pickable(true)

those develoing in c++ might find it really useful though

Using Nodes, my game currently runs at 30 fps

GodotNoob999 | 2018-04-25 11:20

Using nodes is the way to design in godot, if you are having any issues / fps drop and you are sure you are not running any form of compute intensive process, you can open an issue…

funabab | 2018-04-25 16:16

I tested this and found that using RIDs is 4 times faster

GodotNoob999 | 2018-04-25 18:11