Move rotating object
I have a ball which rotates around the point 0,0,0 in the Z-axis. When the space button is pressed, the ball has to go inside the large circle. Now my code looks like this. When you press space, the ball does not behave as they should. I want to know how to make a balloon down exactly down
that's how the ball should behave
void Update () {
if (Input.GetKeyDown (KeyCode.Space)) {
transform.position = new Vector3 (transform.position.x - 1, transform.position.y - 1, 0);
} else {
transform.RotateAround(new Vector3(0,0,0), new Vector3(0,0,1), 2);
}
}
capture-image.png
(27.3 kB)
Comment
Go inside and stay at the center? Or go inside the circle's radius, but keep orbiting?
Your answer
Follow this Question
Related Questions
Transform.Rotate not working around certain axes 1 Answer
How to rotate a camera slowly along a tween? 1 Answer
How to put limit for Transform.rotate in unity 2d 1 Answer
how to disable htc vive pro vr camera rotation and position ? 0 Answers
Whenever Disabling A Collider2d, It still exists in the game. 0 Answers