Great video! Swap positions took me a while after getting used to the tmp=cube1, cube1=cube2, cube2=tmp. In Unity, if you blindly apply that idea, tmp=cube1.position, cube1.position=cube2.position, cube2=tmp.position, that won't work. their y and z position should stay the same while only swap their x position. It is because the localscale is their identity, how big it looks like visually to you, and the y position needs to be pegged to the scale, hence stay the same, z axis never change (unless moving). Just want to share.
couldn't we sort the GameObjects by integer values ? Like a particular integer is set for a particular cubes, so when does the integer get sorted then the correspondent cubes are also sorted ?
Great video! Swap positions took me a while after getting used to the tmp=cube1, cube1=cube2, cube2=tmp. In Unity, if you blindly apply that idea, tmp=cube1.position, cube1.position=cube2.position, cube2=tmp.position, that won't work. their y and z position should stay the same while only swap their x position. It is because the localscale is their identity, how big it looks like visually to you, and the y position needs to be pegged to the scale, hence stay the same, z axis never change (unless moving). Just want to share.
so how do I solve this ;-;
Thank you so mush!💗
couldn't we sort the GameObjects by integer values ? Like a particular integer is set for a particular cubes, so when does the integer get sorted then the correspondent cubes are also sorted ?
up