- Home /
how to rotate a two point in main circle??
i m working on 2d game..
ex:joystick
Void Update()
{
GetMovement();
}
int GetMovement()
{
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
float num = (float)(Screen.width / 2);
return (touch.position.x < num) ? 1 : (-1);
}
return (int)Input.GetAxisRaw("Horizontal") * -1;
}
Are you even getting a result from this ? You are calling Get$$anonymous$$ovement() in the update function as it has a return type void, while the function itself returns an int. I also don't really understand the question, could you explain a bit more what you are trying to achieve? I see that you either return a touch on the left or right side of the screen like an axis, or an inverted horizontal axis, you probably want to use this as your input for rotation?
Your answer
Follow this Question
Related Questions
Armature Rotation, lookAt on y axis, not z axis. 0 Answers
Rigidbody rotation: Use hinge joint motor or MoveRotation script? 0 Answers
How do I rotate a circle of objects so that a specific object is in front of the camera? 2 Answers
Rotate a Cube on swipe gesture iOS, for a specific time? 0 Answers
Unity 2D Apply force in Z Direction 0 Answers