Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerator MoveOverDistance(Vector3 labas)
- {
- Vector3 ledebut = new Vector3(0, 0, 0);
- Vector3 lameuf = new Vector3 (0,0,5);
- float vite = 6f;
- Vector3 outukomence = transform.position;
- Vector3 verlaoutuva = (lameuf - ledebut).normalized;
- float plusloin = Vector3.Distance(ledebut, lameuf);
- float konbientafait = 0f;
- while (konbientafait < plusloin)
- {
- float step = vite * Time.deltaTime;
- transform.position += verlaoutuva * step;
- konbientafait += step;
- yield return null;
- }
- transform.position = lameuf;
- }
Advertisement
Add Comment
Please, Sign In to add comment