-
Notifications
You must be signed in to change notification settings - Fork 26
script camera objects
Attach this script to a game object with regular Unity Camera.
This script will query the map every frame and instantiate specified prefabs for each visible mesh. The instantiated objects will then be rendered with the Unity camera as any other objects would.
To avoid visual artifacts in situations where one camera is rendering objects instantiated by another camera, each instantiated object is assigned a render layer by the camera. The render layer is automatically added to the current Unity Camera component too.
Note that, even that these objects are actually accessible in the game and in the editor, they do not have (and should not have) a collider. Therefore, the objects should be easily passable through by any other objects. To allow collisions, use Collider Probe script.
Since this script instantiates actual Unity Game Objects, their transformation is stored in the unity Transform component, which uses single precision floating point numbers. Therefore, the objects do not have sufficient precision to work on the whole scale from planets to city streets. To solve the issue see the precision topic.
See rendering for more details about cameras, materials and shaders.