- Home /
touch move slide object
hello.
I have the x-axis of a 3D object, but I want to go
See video of "metal storm aces", similar to the plane of the selection
Objects in the script and load only the x-coordinate of the object move.
Touch the screen to the left, to the right a particular x-value, or would like to move one space.
Please Help.
Sorry because poor English. Please understand.
my c# code
float speed = 0.2f;
void Update ()
{
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved)
{
Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
transform.Translate (touchDeltaPosition.x * speed, 0, 0);
}
}
See video link
Comment
Your answer
Follow this Question
Related Questions
iPad touch - Move left/right/jump 0 Answers
How to move a cube to another cube 2 Answers
Sigh... Need help with moving object a distance over time 1 Answer
Rotate Camera around Object 2 Answers