Skip to content

script collider probe

Tomáš Malý edited this page Jan 10, 2019 · 3 revisions

Collider Probe

Attach this script to any game objects that should physically interact with the map.

This script will, much like a camera, query the map object for meshes around this object. However, unlike camera, this script will retrieve meshes from a fixed lod (level of detail) and up to some specified distance. The camera will than instantiate specified prefab and assign it the meshes. The prefab should be configured such that the original game object may collide with them.

Moreover, this script does not use frustum culling and will, therefore, acquire meshes in all directions. This behavior is intended so that quickly turning objects do not fall through.

Finally, the maximum distance should be set such that the collider meshes have enough time to be prepared even for fast moving objects.

Collisions with the objects instantiated by this script are not limited to the object with this instance of the Collider Probe script. This may, in some degree, be achieved by the Unity collision layers. On the other hand, it allows to share single collider probe (attached to eg. an Empty) between multiple actors.

The objects instantiated by this script cannot be directly seen in the game nor in the editor. However, if you select them in the Hierarchy tab, you may see their outlines in the Scene tab.

Similarly to the Camera Objects, the objects instantiated by this script have insufficient precision and will only work in a small area around world origin. To overcome this issue, see precision topic.