- Home /
Camera Controls Need Help
Hey guys, I am trying to code a camera follow script that only follows the player on the Y axis which I have achieved, what I am struggling on is how to make it so the camera only follows the player if he is going up, so if he falls the camera stays still and he is able to fall of the screen. There must be a simple answer but I just cant see it. Any help would be greatly appreciated. Thanks in advanced.
Answer by Sephius · Aug 26, 2014 at 06:49 PM
if( YourPlayer.transform.position.y > YourCamera.transform.position.y)
{
YourPlayer.transform.position.y = YourCamera.transform.position.y;
}
Or something like that, right ?
You can also store the previous pos of the player and update your cam only if its current y pos is > previous y pos
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Make player not be seen by AI, when player in foilage and shadows. 1 Answer
Starting out C# help 2 Answers
Third person movement similar to Max Payne 1 Answer
Animation Scripting c# help 2 Answers