- Home /
Question by
luckynz · Apr 20, 2012 at 09:50 AM ·
raycastterrainterraindata
Get raycast hit objects terrainData
Hey guys, I have multiple terrains in my scene and I need to detect which one is being hit with my raycast to parse the right TerrainData to my function. Here is my code, I understand that there is not way that it works but is the only one that compiles so I figure it's the closest I have got.
TerrainData myData = hit.transform.gameObject.GetComponent<Terrain>().terrainData
With hit being my RayCast hit;
Appreciate any help!
Thanks!
Comment
Your answer
Follow this Question
Related Questions
Terrain heightmap isn't smooth 0 Answers
Absolute Position of Terrain Data 2 Answers
Why does my tree script not work 0 Answers
How can I separate tree colliders from terrain colliders? 2 Answers