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

Name of property of anchoredPosition.y for use in SetCurve?

Discussion in 'UGUI & TextMesh Pro' started by petrapparent, Sep 20, 2014.

  1. petrapparent

    petrapparent

    Joined:
    Jun 6, 2011
    Posts:
    28
    Hi All,

    I've followed up with several threads, but nothing seemed to help. I'm trying to create an animation for uGUI RectTransform's anchoredPosition.y

    Using the following property name "anchoredPosition.y" fails to bind the curve. What is the property name I should use?

    e.g.

    clip.SetCurve ("", typeof (RectTransform), "anchoredPosition.y", curve);

    Petr
     
  2. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    idk but shows like this in anim file

     
  3. Dover8

    Dover8

    Joined:
    Aug 20, 2010
    Posts:
    94
    rakkarage you are spot on, this helped me out big time. Correct C# code is:

    Code (CSharp):
    1. clip.SetCurve("", typeof(RectTransform), "m_AnchoredPosition.y", curve);
     
  4. daoth90

    daoth90

    Joined:
    Jul 28, 2016
    Posts:
    7
    I am too late here, but could you teach how to get it?
     
  5. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    get what?
    you can set text mode on too see in animation files
    unity-editor-settings-asset-mode.png

    or you can just use anchoredPosition in animation
    44720-buttoncurve.png

    or in code like above