- Home /
This question was
closed Dec 20, 2014 at 08:33 AM by
AlucardJay for the following reason:
Duplicate Question : http://answers.unity3d.com/questions/858697/keep-an-object-accurately-on-top-of-bumpy-terrain.html
get the height of every pixel in a terrain so that i can make more precise player terrain collision?
I have this so far in update under the terrain object
if (PlayerGet.rigidbody.transform.position.y - PlayerGet.transform.lossyScale.y / 2 < transform.position.y)
{
PlayerGet.rigidbody.transform.position += Vector3.up * Time.deltaTime;
}
I want to replace transform.position.y with individual pixels of the terrain?
Comment
You could shoot a raycast down from the Player's position and get the Y of the terrain, then use that for whatever your purposes are.
Follow this Question
Related Questions
Make a simple tree 1 Answer
Terrain material breaking when adding holes 0 Answers
Help with a target reticle moving across terrain 2 Answers
Making a particle effect parallel to the slope of a terrain 1 Answer
Gap grass problem? 1 Answer