Support => NGUI 3 Support => Topic started by: CoreWorkNode on November 17, 2014, 11:24:13 AM
Title: Add Child to Grid via Instantiate
Post by: CoreWorkNode on November 17, 2014, 11:24:13 AM
So unfortunately I am using Photon Network as I have been for so long I do not wish to change. However, When I PhotonNetwork.Instantiate "so other players can see the elements" I run into the snag.
My "PlayerCard" makes my Grid act odd, by stretching it out of frame.When I reset the Transform component on my PlayerCard via IDE it goes into frame like it should.
(http://imageshack.com/a/img674/8353/n4cSie.png) As I am posting this Image I realized my, PlayerCard is being spawned with the size set at 300,300,300.
Title: Re: Add Child to Grid via Instantiate
Post by: CoreWorkNode on November 17, 2014, 11:29:27 AM
For sure a problem with size. It only does this when I Parent the Grid to the PlayerCard. hmm.
This is working but it does not feel "politically correct"
Title: Re: Add Child to Grid via Instantiate
Post by: ArenMook on November 18, 2014, 05:12:58 AM
NGUITools.AddChild resets the scale, among other things.
I don't know how Photon works here, but in TNet, all instantiation is not immediate. It's delayed so that it occurs on all clients. The fact that you're changing the parent right away like that suggests to me that it only happens on one client, but again -- I don't know how photon works here.
Title: Re: Add Child to Grid via Instantiate
Post by: CoreWorkNode on November 20, 2014, 09:32:34 AM
Thanks for the Reply Aren. Yeah, I Love NGUITools., Seems Photon does not play nice with NGUI gui elements sometimes. I may eat my words & switch to TNet, So my networking would get along with NGUI. I rather have NGUI than Photon. (lol)