Quantcast
Channel: Questions in topic: "unity2d"
Viewing all articles
Browse latest Browse all 60

Move infinitely in targeted direction

$
0
0
For my game, I want to move my game object in specific direction but it has to travel any number of units. At present I have following code for deciding direciton. Vector3 direction = targetPlayer.position - transform.position; float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg; Using above code I have correction direction of object. But how to move game object infinitely on same direction founded? Please give some opinions in this.

Viewing all articles
Browse latest Browse all 60

Trending Articles



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