Skip to content

InstantiateRandomTrees

janlucakaestle edited this page Feb 16, 2021 · 3 revisions

Instance of: NetworkController

Description

public void InstantiateRandomTrees()

This function creates trees randomly along the roads up to a certain distance.

Parameters

NumberOfTrees

Can be set in the Unity GUI in NetworkController Tab. Defines the number of trees to be spawned.

DistanceHorizon

Can be set in the Unity GUI in NetworkController Tab. Sets the maximum distance between a road segment and a tree spawning point.

Return Values

Spawns NumberOfTrees trees as GameObjects within the Trees GameObjectParent.

Examples

Tree spawning areas

Trees will spawn randomly in the blue shaded rectangles.

Clone this wiki locally