| | |
| | | public virtual void Move(Vector3 worldPosition, Quaternion rotation, bool validLocation) |
| | | { |
| | | m_TargetPosition = worldPosition; |
| | | |
| | | if (!m_ValidPos) |
| | | { |
| | | // Immediately move to the given position |
| | |
| | | |
| | | if (Vector3.SqrMagnitude(currentPos - m_TargetPosition) > 0.01f) |
| | | { |
| | | currentPos = Vector3.SmoothDamp(currentPos, m_TargetPosition, ref m_MoveVel, dampSpeed); |
| | | //currentPos = Vector3.SmoothDamp(currentPos, m_TargetPosition, ref m_MoveVel, dampSpeed); |
| | | |
| | | transform.position = currentPos; |
| | | //transform.position = currentPos; |
| | | transform.position = m_TargetPosition; |
| | | |
| | | } |
| | | else |
| | | { |