-
Notifications
You must be signed in to change notification settings - Fork 0
InstantiateRandomTrees
janlucakaestle edited this page Feb 19, 2021
·
3 revisions
Instance of: NetworkController
public void InstantiateRandomTrees()
This function creates trees randomly along the roads up to a certain distance.
Can be set in the Unity GUI in NetworkController Tab. Defines the number of trees to be spawned.
Can be set in the Unity GUI in NetworkController Tab. Sets the maximum distance between a road segment and a tree spawning point.
Spawns NumberOfTrees trees as GameObjects within the Trees GameObjectParent.

Trees will spawn randomly in the blue shaded rectangles.
If a road is exactly aligned with the x axis, there might be a problem with the current shape of boxes: Possible solution: read the angle of the road segments and make non-rectangular (e.g. trapezoid) boxes instead.