The question is answered. OP unresponsive.
ullReferenceException: Object reference not set to an instance of an object SystemConnect.Update () (at Assets/EAO7 Scripts/Online/SystemConnect.cs:48)
Script appears to be correct however run into this error on RPC view line. ullReferenceException: Object reference not set to an instance of an object SystemConnect.Update () (at Assets/EAO7 Scripts/Online/SystemConnect.cs:48)
void Update () {
if(RegisterAttempt > 0){
nView.RPC("RegisterAttemptRPC", RPCMode.AllBuffered, null);
RegisterAttempt -= -1;
} else {
Debug.Log("No Attempt Made");
}
if(LogginAttempt > 0){
nView.RPC("LogginAttemptRPC", RPCMode.AllBuffered, null);
LogginAttempt -= -1;
} else {
Debug.Log("No Loggin Attempt Made");
}
if(AccountLoaded > 0) {
nView.RPC("DISAccount", RPCMode.AllBuffered, null);
}
else {
Debug.Log("Awaiting Logging Attempt");
}
}
//________________________________________________________________________________________________________________________________________
[PunRPC]
public void LogginAttemptRPC () {
// Gather Username and Acount Details Input from User.
LogginUsernameAttempt = ClientLogginRegister.UsernameClient;
LogginPasswordAttempt = ClientLogginRegister.PasswrodClient;
LogginAttempt += + 1; // make 1 Attempt to logg in with username and password.
Debug.Log("Attempting First Loggin Pass");
}
//________________________________________________________________________________________________________________________________________
[PunRPC] // send Account information to the server from Client.
public void RegisterAttemptRPC () {
// Gather Username and Acount Details Input from User.
RegisterUsernameAttempt = ClientLogginRegister.UsernameClient;
RegisterPasswordAttempt = ClientLogginRegister.PasswrodClient;
RegisterAttempt += + 1; // make 1 Register Attempt to Register New Account.
Debug.Log("Attempting First Register Pass");
}
It's not cause the spelling mistake 'Pass*wrod*Client'?
on which line pretty sure pelt password the same way on all scripts.
nView.RPC("RegisterAttemptRPC", RPC$$anonymous$$ode.AllBuffered, null); has the error.
Line 35&46: RegisterPasswordAttempt = ClientLogginRegister.Passw*ro*dClient;
Good catch Ambrose!
However, I don't think that's what causes the issue. The exception causing the problem is raised in the Update() method and code with a "typo" would not compile.
Answer by a7BiT-psycho · Nov 23, 2015 at 10:17 AM
A NullReferenceException means that you are trying to "use" an object which is null(not initialized). Since the only object used in the Update() Method is nView, make sure that nView is actually initialized. This is usually done by calling a constructor in the Awake() method or by assigning a value to it in the Inspector.