Quantcast
Channel: Latest Questions by RedDevil
Viewing all articles
Browse latest Browse all 100

Mobile touch dragging from mouse dragging

$
0
0
Hi.So i have this function made to drag an object by the mouse and i want it to do the same with touch.Can you guys help? void Dragging () { Vector3 mouseWorldPoint = Camera.main.ScreenToWorldPoint(Input.mousePosition); Vector2 catapultToMouse = mouseWorldPoint - catapult.position; if (catapultToMouse.sqrMagnitude > maxStretchSqr) { rayToMouse.direction = catapultToMouse; mouseWorldPoint = rayToMouse.GetPoint(maxStretch); } mouseWorldPoint.z = 0f; transform.position = mouseWorldPoint; }

Viewing all articles
Browse latest Browse all 100

Trending Articles



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