- Home /
Sending Player to other Script
Hello there,
I want to send the player to another script to set a value on the player using this.
public JGOGameManager GameManager;
.
.
.
GameManager.SendPlayerDone (this);
The recieving code looks like this :
public void SendPlayerDone(JGOPlayer_Physics Player) {
FinishedPlayers++;
if(FinishedPlayers == 1)
{
StartCoroutine (StartFinishCountdown ());
}
Player.SetPlayerPlace(FinishedPlayers);
}
Unfortunately, my code is not working. I get this error
NullReferenceException: Object reference not set to an instance of an object
How can I send the player himself to the script?
Greetz, ITGeist.
Answer by prof · Dec 07, 2013 at 08:08 PM
I guess you forgot set GameManager in editor. Code looks fine (workable)
It is already set in Editor and Network $$anonymous$$anager is attached to it.
Your answer
Follow this Question
Related Questions
how can i send challenge to my Facebook friends from my app.? 2 Answers
Android Calling? 0 Answers
Server as to be on the same scene as the client 0 Answers
About untity send messages with android? 0 Answers
How to get camera to follow player 2d 11 Answers