- Home /
Question by
Eco-Editor · Sep 07, 2017 at 03:22 PM ·
c#scripting problemfunctionarray list
Script will be found on the client but not on the server.
Hi all,
I have a really big problem. I have a multi player set up, when I toggle events on and off based on whether it is a local or a not a local player.
Both players have a script, that is "enabled" only on the localPlayer. each time I start a new set up (in the same scene) I ask another script to call a function in the script that is on the player. So I set a reference to the arrays of that script:
public class FindAvatar : NetworkBehaviour
{
TriggerDetection [] td;
void Start()
{
if (td == null)
{
print("no script exist");
}
td = FindObjectsOfType<TriggerDetection>();
// td.FindAvatars(); //HERE is my problem. Normally if it were'nt an array I'd be able to call this function for the TriggerDetection script. BUT now that it's an array it won't let me.
}
}
}
Comment