[Feature] Made text move

This commit is contained in:
Pasha Bibko
2025-12-02 15:35:31 +00:00
parent 28280d87cc
commit df1a1c145e
2 changed files with 8 additions and 4 deletions

View File

@@ -108,8 +108,10 @@ public class PlayerController : OrbitalBehaviour
private IEnumerator OnModiferPickup()
{
Vector3 start = TranslateToVector3();
Vector3 end = Vector3.zero;
Vector3 direction = start - end;
Vector3 direction = Vector3.zero - start;
direction.Normalize();
direction *= 3;
Vector3 end = start + direction;
m_ModifierText.transform.position = start;
@@ -117,9 +119,10 @@ public class PlayerController : OrbitalBehaviour
Color endColor = m_ModifierText.color;
endColor.a = 0;
for (float lerp = 0f; lerp < 1f; lerp += Time.deltaTime)
for (float lerp = 0f; lerp < 1f; lerp += Time.deltaTime / 2f)
{
m_ModifierText.color = Color.Lerp(startColor, endColor, lerp);
m_ModifierText.transform.position = Vector3.Lerp(start, end, lerp);
yield return new WaitForEndOfFrame();
}