Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Move()
- {
- _currentTime += Time.deltaTime;
- var linearTime = _currentTime / projectileSo.travelDuration;
- float movePositionX = Mathf.Lerp(_startPosition.x, _targetPosition.x, linearTime);
- float movePositionZ = Mathf.Lerp(_startPosition.z, _targetPosition.z, linearTime);
- var movePosition = new Vector3(movePositionX, transform.position.y, movePositionZ);
- var baseY = Mathf.Lerp(_startPosition.y, _targetPosition.y - offset, linearTime);
- var arc = projectileSo.curveMaxHeight * projectileSo.curveHeight.Evaluate(linearTime);
- movePosition.y = baseY + arc;
- transform.position = movePosition;
- }
Advertisement
Add Comment
Please, Sign In to add comment