Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
private void Update()
{
rigidbody2D.velocity = new Vector2(speed, rigidbody2D.velocity.y);
if (leftPos != leftBttn.transform.position.y)
{
//rigidbody2D.velocity = new Vector2(speed, rigidbody2D.velocity.y);
speed = -5f;
}
else if (rightPos != rightBttn.transform.position.y)
{
speed = 5f;
}
else
{
speed = 0f;
}
rigidbody2D.velocity = new Vector2(speed, rigidbody2D.velocity.y);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question