Question by
hamzachaudhry · Jul 24, 2016 at 01:10 PM ·
rotationsphere
how can i rotate the ball in left direction if it was in forward direction and vice versa , like a real ball?
if (Input.GetMouseButtonDown(0) && !isDead)
{
isPlaying = true;
score++;
scoreText.text = score.ToString();
if (dir==Vector3.forward)
{
dir = Vector3.left;
}
else
{
dir = Vector3.forward;
}
}
float amountToMove = speed * Time.deltaTime;
transform.Translate(dir * amountToMove);
}
Comment
Your answer
Follow this Question
Related Questions
Move rotating object by friction 0 Answers
How to rotate object in sphere 0 Answers
How to make camera moving as the player on a planet 0 Answers
Calculating the Hit Point on a Sphere (with Rotation, Based on Static Nodes) 0 Answers
Movement of a sphere 0 Answers