Instantiate and RectTransform.sizeDelta cannot be used in the same frame.

Unity 2017.3
Please find attached my tiny 23KB UnityPackage that contains a bug.

Red is the bug.

Follow these steps:

  • Run the project
  • Press button A
  • Press button B
  • Notice the emoji’s position
  • Stop the project
  • Run it again
  • Press button AB
  • Notice that the emoji’s position is different
  • Look at the “OnClick” listeners of the buttons A, B, and AB

I’ve submitted the bug to the bug report through the editor, but based experience, my bug won’t be noticed there; maybe there will be more visibility here.

EDIT: 984954_2609ai05jiioqhrg is the case number

3342764–261090–EmojiGame.unitypackage (22.2 KB)

You might want to leave that case number here, so Unity Technologies can find your report, if they’re looking at the forum first.