Author Topic: Input Caret GameObject having Transform instead of RectTransform on 5.5.2p2  (Read 7684 times)

mh114

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Just heard from the Unity developer(s) responsible for this part of their code and they will be revising the handling of adding components like RectTransforms in Awake.

Long story short, I will be able to modify the current Caret object creation by simply using the following where the RectTransform is added as the object is created.

Code: C#
  1. GameObject go = new GameObject(transform.name + " Input Caret", typeof(RectTransform));
  2.  

Note: Creating a new object and then adding a RectTransform using AddComponent() will no longer be possible in Awake(). But as shown above, creating a new object and adding the RectTransform in that same function will still work in Awake(). This last part isn't really related to TMP but just good overall stuff to know in Unity.

I noticed TMP beta 8 had been released, with separate version for 5.5 and 5.6. Does the b8 for 5.5 work around this Awake() / RectTransform issue? We're still stuck with 5.5.2p1 because of the issue.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Just heard from the Unity developer(s) responsible for this part of their code and they will be revising the handling of adding components like RectTransforms in Awake.

Long story short, I will be able to modify the current Caret object creation by simply using the following where the RectTransform is added as the object is created.

Code: C#
  1. GameObject go = new GameObject(transform.name + " Input Caret", typeof(RectTransform));
  2.  

Note: Creating a new object and then adding a RectTransform using AddComponent() will no longer be possible in Awake(). But as shown above, creating a new object and adding the RectTransform in that same function will still work in Awake(). This last part isn't really related to TMP but just good overall stuff to know in Unity.

I noticed TMP beta 8 had been released, with separate version for 5.5 and 5.6. Does the b8 for 5.5 work around this Awake() / RectTransform issue? We're still stuck with 5.5.2p1 because of the issue.

Unity fixed this issue in the soon to be released Unity 5.6.0f3.

This should also be fixed in the next Unity 5.5 patch which will hopefully be available next week.

BTW: I am not certain this is the last tweak we will see on this. Right now, creating new GameObjects in Awake and adding a RectTransform afterwards still can result in issues which will trip up users and developers.
« Last Edit: March 31, 2017, 02:00:21 AM by Stephan B. »

mh114

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Alright, thanks for the info. I'll wait for the next 5.5 patch, then.

mh114

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
Anyone tested 5.5.3p1, if the problem still persists? I will test it myself today unless somebody reports that it isn't fixed yet..

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
Anyone tested 5.5.3p1, if the problem still persists? I will test it myself today unless somebody reports that it isn't fixed yet..

This issue is fixed in Unity 5.6 but it doesn't appear that it has been fixed in Unity 5.5.3p1 yet.

mh114

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
This issue is fixed in Unity 5.6 but it doesn't appear that it has been fixed in Unity 5.5.3p1 yet.
Bummer! Thanks for replying though. Maybe next week? EDIT: Or this week, rather..
« Last Edit: April 10, 2017, 10:22:40 PM by mh114 »

atraver

  • Newbie
  • *
  • Posts: 1
It looks like this functionality has not been added to 5.5.3p2, either. Stephen, do you have any info about whether or not it's going to land in the 5.5 branch, or is it just headed for 5.6 and 2017.1?

Fortunately, it looks as though avee's workaround does the job for now, but it's not really something I'd like to keep in my project.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
It looks like this functionality has not been added to 5.5.3p2, either. Stephen, do you have any info about whether or not it's going to land in the 5.5 branch, or is it just headed for 5.6 and 2017.1?

Fortunately, it looks as though avee's workaround does the job for now, but it's not really something I'd like to keep in my project.

Let me check when this is suppose to make it into 5.5.

mh114

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
5.5.3p3 has a promising change:
(902580) - Editor: Fixed an issue that prevented the creation of GameObjects with a RectTransform component.

Do you know if that indeed solves this issue?

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5687
5.5.3p3 has a promising change:
(902580) - Editor: Fixed an issue that prevented the creation of GameObjects with a RectTransform component.

Do you know if that indeed solves this issue?

I have not had a chance to test it but I know these issues are / have been worked on.

mh114

  • Beta User
  • Jr. Member
  • *
  • Posts: 54
It seems that 5.5.3p3 solved the issue, finally.