Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Transfer canvas position to world position?

Discussion in 'UGUI & TextMesh Pro' started by Damast, Feb 19, 2021.

  1. Damast

    Damast

    Joined:
    Apr 25, 2019
    Posts:
    13
    Hey, I have a canvas with a tmp text and would like to create an animation that moves a ball (in a curve) exactly into the "O" in my text.

    My previous approach would be to try to translate the position of the text into the world coordinates using a script and then move the ball there.

    If someone has an idea how I could implement it, I would be very happy!
     
  2. Damast

    Damast

    Joined:
    Apr 25, 2019
    Posts:
    13
    How I solved it so far:

    Code (CSharp):
    1. Ball.transform.DOJump(new Vector3(ballAnimPos.localToWorldMatrix.m03, ballAnimPos.localToWorldMatrix.m13), 1f, 1, 2f);