- Home /
Tracking information across terrain
What would be the best method of tracking information across terrain? Say I want to track ambient temperature across the terrain where different segments of the terrain have different temperatures and over the course of the game temperatures can change so I don't believe I can use a heightmap as I think they are read-only though that would otherwise be a good solution. It would be helpful as well if the suggestion also incorperated ways for diffusion type effects could also be worked out where a overly hot area would slowly diffuse the heat over time.
Any way I can do this in javascript would be best though C# is fine as well.
Thank you
Answer by Eric5h5 · Jun 17, 2010 at 05:59 PM
The terrain heightmap isn't read-only; that's what you're manipulating when you use GetHeights and SetHeights. However since that's for the terrain height you can't use that for other info anyway. The thing to do would be to make a float[] array that stores the values for ambient temperature, and map that to the terrain. You can then go through the array periodically and perform some diffusion algorithm on it.
I tried using get/set height but I kept getting exceptions... I'll have to try again. I was hoping there was a better solution than just using arrays, but that makes the most sense, Thanks
Your answer
Follow this Question
Related Questions
Setting Scroll View Width GUILayout 1 Answer
Can someone help me fix my Javascript for Flickering Light? 6 Answers
generate terrain by script 0 Answers
DDT script only works on one terrain 1 Answer