- Home /
Question by
sthhere11 · Dec 23, 2013 at 05:06 AM ·
inputtouchhorizontal movement
How can I use Input touch for this script.
How can I convert this code to work with touch in windows and windows phone..
float moveInput = Input.GetAxis ("Horizontal") Time.deltaTime 6; transform.position += new Vector3 (moveInput, 0, 0);
if (transform.position.x <= -3.5f || transform.position.x >= 1.5f) {
float xPos = Mathf.Clamp (transform.position.x, -3.5f, 1.5f);
transform.position = new Vector3 (xPos, transform.position.y, transform.position.z);
}
I want to drag the gameobject with a limited range in x axis.
Comment
Your answer
Follow this Question
Related Questions
Problem getting touch input 0 Answers
index out of bounds 6 Answers
IOS object touch, collider 1 Answer
Pinching invokes SingleTouch 1 Answer
Switch Between Touch And Mouse Controls 0 Answers