Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IEnumerator MoveOverDistance()
- {
- direction = (transform.position - startPosition).normalized;
- float currentDistance = 0f;
- float distance = //jusqu'à l'infinie et au delà
- while (currentDistance < distance)
- {
- float step = speed * Time.deltaTime;
- transform.position += direction * step;
- currentDistance = Vector3.Distance(startPos, transform.position);
- yield return null;
- }
- transform.position = startPos + direction * distance;
- }
Advertisement
Add Comment
Please, Sign In to add comment