Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

how to add a speed limit?

$
0
0
foreach (Touch input in Input.touches) { if (input.phase == TouchPhase.Moved) { Vector3 screenPoint = new Vector3 (Input.mousePosition.x, 65); screenPoint.z = 11; //distance of the plane from the camera transform.position = Camera.main.ScreenToWorldPoint(screenPoint); } } The object follows the touch, but how do I get it moving with a velocity from position A to position B?

Viewing all articles
Browse latest Browse all 536

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>