Section 7.2. Proximity Proxies

Proximity Proxies are a great way to save FPS and VRAM – and they’re easy to set up.

All you need to do is assign a mesh, an instance of a mesh or a prefab to a Proxy – rdInst does the rest.

The above code assigns a Proxy Actor “BP_MyProxyActor” to the single instance created in the previous Node.

This one is similar, but instead of assigning the single instance, it assigns the mesh itself – all instances of the mesh will be swapped to the proxy. You specify this by using “-1” as the Instance Index value.

This is the most optimal type of Proxy.

If your Proxy is using the same meshes, you can tick the “Don’t Hide” option and remove those meshes from the proxy – that reduces CPU time during the swap. A good example of this is adding collision to trees – you can turn off collision on the meshes themselves, that speeds up spawning/creation by a large amount. Then have a ProxyActor which is just a Collision Cylinder the size of the tree trunk – tick the ‘Don’t Hide’ and then when the player is in proximity, the collision cylinder is shown.

A Prefab Proxy is added in much the same way, just pass the Prefab to the rdAddPrefabProxy Node.


There is also another way to add Proximity Prefabs, and this is through the rdSpawnStuffActor – and in particular, in Baked rdSpawnStuffActors – or just rdSpawnStuffData.

rdInst and rdBPtools have tools to bake actors and instances into small rdSpawnStuffData structures which are stored in the rdBase singleton and scanned depending on proximity. rdInst can do this at runtime – a good example is spawning trees and foliage with PCG (having collision turned off on the meshes), then having rdInst bake the PCG data into a series of rdSpawnStuffData stuctures based on distance – just Adding a Proxy for those instances then gives you high-speed distance-based scanning of all those instances to add collision cylinders in proximity.


Tutorials