- Home /
Duplicate Question
Making the player be sticked to the ground, help please!
Hello, guys! I need help: I'm making a Slenderman game. I made Slendy teleport to GameObjects around the player, but there are mountains on my terrain, so he spawns or too high above the terrain, or under it. Please help me with getting a script, to make him spawn exactly on the terrain and to remain there at all times! Don't dissapoint Slendy, he's a cutie!
Posting a question without searching to see if it has already been asked is about the only thing lamer than needing help to make yet another freakin' Slender knockoff.
Answer by uberokeer · Jul 09, 2013 at 06:17 PM
Well here's the answer to one of your questions. If you want him to spawn above the terrain and not in it, then you will need physics of course. and then after you move him to the location you will need to add to the Y axis about 25 or so, depends on how much he is going in the ground.
The code will look something like this.
function Update(){
//Move slender to gameobject near player
//under certain circumstances move him above ground using gameobject.transform.position.Y += 25; depends on how high above ground he is.
}
sorry i'm not sure about the code for this because you didn't give much to work with. :P
Follow this Question
Related Questions
SampleHeight, Object refference not set to an instance of an object error 1 Answer
Character height issue 0 Answers
Problem with Terrain.SampleHeight 0 Answers
Make a simple tree 1 Answer