// ---- protected methods ---- protected void CalculatePath() { float anglePitch = GetPitchAngle(originTransform); float angleYaw = GetYawAngle(originTransform); float initialHeight = originTransform.position.y - groundHeight; // FIXME: target height is unknown float distance = Trajectory.DistanceAtAngle(anglePitch, velocity, initialHeight, -Physics.gravity.y); float x = Mathf.Sin(angleYaw) * distance; float y = groundHeight - originTransform.position.y + 5; float z = Mathf.Cos(angleYaw) * distance; Vector3 impactLocation = originTransform.position + new Vector3(x, y, z); // set target position reticleTransform.position = impactLocation; DrawTrajectory(originTransform.position, impactLocation, distance); }