Add score when camera moves
Hello,
I am making a jump up game. I have tried different ways to get score, but the only realistic way is to add +1 whenever the camera moves on the Y axis.
This script is for the camera to move up when the player lands on a platform. But I want a way to add +1 score, but since its in the update function it goes up in frames.
any ideas? Thanks
private void Start ()
{
thisTransform = transform;
}
public void FixedUpdate()
{
grounded = Physics2D.IsTouchingLayers(myCollider, whatIsGround);
if (grounded)
{
Vector3 vec = thisTransform.position;
//vec.x = Mathf.SmoothDamp (thisTransform.position.x, target.position.x, ref velocity.x, smoothTime);
vec.y = Mathf.SmoothDamp (thisTransform.position.y, target.position.y, ref velocity.y, smoothTime);
thisTransform.position = vec;
cameraMoved = true;
}
}
EDIT: In my score manager I put if (cameraMoved == true){ scoreCount+=1;}
Comment
Your answer
Follow this Question
Related Questions
How do you add +1 to a score counter after a destroy script (C#)? 1 Answer
Different Score for Active OnMouseDown objects 0 Answers
Score/Resource Counter 1 Answer
Kill counter doesn't stop counting 0 Answers
GameOver Score Counter 2 Answers