Question by
Brylos · Dec 13, 2016 at 07:30 PM ·
networkingreferencing
Find child script instance from network identity?
So i'm trying to have a script on my player controller prefab find an int from a script that is attached to a child object of it.
public NetworkIdentity NI;
public static GameObject HitboxScriptFind;
HitboxScriptFind = NetworkServer.FindLocalObject(NI.netId);
HitboxScriptFind.GetComponentInChildren<Hitbox>();
This is basically as far as I've gotten with it. I'm not sure how to make it reference the script instance that is attached to it. I just need to get an int from the script. Anyone have an idea how to do this properly? Thanks in advance.
Comment