- Home /
Load trees and grass in a certain radius of the player only
Hello there.
I have been wondering for quite some time now, on how to load grass/plants/trees in a certain radius of the player. My map has high fog density, so I don't need the player to see trees nor grass/plants in a radius greater than 20yards or so.
How do I achieve wanted effect?
Sincerely, Krakinoz.
If you make those objects have empty parent containers that have their own Trigger colliders, then you could simply use Physics.OverlapSphere() for detecting, and have the parent container for that object disable/enable it's child. (if you disable it directly, you'll have no way of re-enabling it).
Or you could have a Global GameObject variable containing your player object reference, and on the parent object of each of those, have a script check the distance from the player, and disable it's child if it's too far.
Answer by TheShadowblast123 · Jan 20, 2014 at 12:13 AM
funny you mention radius, The easiest way I could think of doing this would be with make a sphere detect trees and turn on their renderers, SIMPLE (in theory)
Your answer
Follow this Question
Related Questions
Loading a level on contact 2 Answers
Import assets through script 0 Answers
Multiple terrains and how LoD works 0 Answers
Loading bar with visual bar 1 Answer