We will entertain your mind, enhance your brain, expand your lifestyle.

The Mystery of ‘Parent’

While checking puzzles in an app we built for the iPad, one puzzle did not work properly.

The puzzle has four pieces in each of three frames, which come together outside the frame at the start of the puzzle and return to the frame at the end.

This gathering/returning action manipulates the parent of each piece, but it was not working correctly because the script ‘GatherBehavior’ of the gathering object ‘Gather’ was using this.parent instead of this.transform.

This issue has been fixed, but the mystery is that in versions before the build, this.parent returns the parent of Gather, but in versions after the build, it returns null. Why is there a difference even though the Unity version is the same?