Toadill's Profile User Rating: -----

Reputation: 45 Craftsman
Group:
Active Members
Active Posts:
401 (0.41 per day)
Joined:
08-January 12
Profile Views:
14,499
Last Active:
User is offline Sep 18 2014 07:11 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Who Cares
Favorite Gaming Platform:
PC
Your Car:
Ford
Dream Kudos:
0

Latest Visitors

Icon   Toadill Pending.........

Posts I've Made

  1. In Topic: Unity photon network prefab not loading properly

    Posted 28 Aug 2014

    I have found that the way I have it works fine. I am just using a newer version of photon network and I guess some changes have been made to it since the tutorial I am using has been release.
    I also figured out the console error message problem, but thanks!
  2. In Topic: Unity photon network prefab not loading properly

    Posted 22 Aug 2014

    I have still not found a solution for this yet. Any help is appreciated.
  3. In Topic: Unity photon network prefab not loading properly

    Posted 21 Aug 2014

    Here it is running


    I believe this maybe where its failing

     PhotonNetwork.Instantiate("PlayerController", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
    
    
  4. In Topic: Unity photon network spawn spots

    Posted 21 Aug 2014

    Yeah C#
    I got it now here is the working code

    using UnityEngine;
    using System.Collections;
    
    public class NetworkManager : MonoBehaviour 
    {
    	public Camera StandByCamera;
    	SpawnSpot[] spawnSpots;
    	// Use this for initialization
    	void Start () 
    	{
    		spawnSpots = GameObject.FindObjectsOfType<SpawnSpot> ();
    		Connect();
    	}
    	
    	void Connect()
    	{
    		PhotonNetwork.ConnectUsingSettings ("Version 00.1");
    	}
    
    	void OnGUI()	
    	{
    		GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
    	}
    
    	void OnJoinLobby()
    	{
    		PhotonNetwork.JoinRandomRoom ();
    		Debug.Log ("OnJoinLobby");
    	}
    
    	void OnPhotonRandomJoinFailed()
    	{
    		PhotonNetwork.CreateRoom (null);
    	}
    
    	void OnJoinedRoom()
    	{
    		Debug.Log ("OnJoinedRoom");
    
    		SpawnMyPlayer ();
    	}
    
    	void SpawnMyPlayer()
    	{
    		if (spawnSpots == null) 
    		{
    			Debug.Log ("SpawnPlayerError");
    			return;
    		}
    		SpawnSpot mySpawnSpot = spawnSpots[Random.Range(0, spawnSpots.Length)];
    		PhotonNetwork.Instantiate ("PlayerController", mySpawnSpot.transform.position, mySpawnSpot.transform.rotation, 0);
    	}
    }
    
    


    Thanks!

    View Postmodi123_1, on 21 August 2014 - 11:47 AM, said:

    The first one - listen to the error. Use ( ) and not < >.

    Quote

    Consider using parentheses to invoke the method

    12	            spawnSpots = GameObject.FindObjectOfType<SpawnSpot>;
    


    The second error - are you not using the right variable name? Are you trying to access the objects inside of the variable "spawnSpots"? If yes then fix the name and take this as a reason why you shouldn't have variable names too similar to the class name. If not then what are you trying to do? Use a constructor? If so constructors do not utilize the [ or ], but the ( and ).


    07	    SpawnSpot[] spawnSpots;
    
    55	        SpawnSpot mySpawnSpot = SpawnSpot[Random.Range(0, spawnSpots.Length)];
    


    The second error was like you said it was spawnSpots not SpawnSpot


    SpawnSpot mySpawnSpot = spawnSpots[Random.Range(0, spawnSpots.Length)];
    
    


    I am actually watching a series of tutorials to learn the networking side of Unity. I can appreciate your suggestion of using bettering names. lol

    Thanks again!
  5. In Topic: Unity photon network spawn spots

    Posted 21 Aug 2014

    View Postmodi123_1, on 21 August 2014 - 11:54 AM, said:

    Okay.. then tell it so.

     GameObject.FindObjectOfType(typeof(SpawnSpot));
    


    spawnSpots = GameObject.FindObjectsOfType(typeof(SpawnSpot)); 
    


    I've tried this and got this error


    SpawnSpot is a type but used like a variable


    Okay UPDATE this fixed the first error

    spawnSpots = GameObject.FindObjectsOfType<SpawnSpot> ();
    

My Information

Member Title:
D.I.C Regular
Age:
32 years old
Birthday:
October 2, 1981
Gender:
Location:
USA
Interests:
Technical/ Skills Summary

Visual Basic.Net
C#
C++
Visual Basic 6.0
HTML
ASP.NET
DirectX 9, 10
Open MP
Boost
UML
Visio
Object Oriented Programming
UDK Engine
SQL Server
SQL Express
Tortoise SVN
Access 2010
Windows O/S networking
Microsoft Office
Delphi 7
Java
RPG on the AS/400 Mainframe
Full Name:
James Leshko
Years Programming:
15
Programming Languages:
C++
C#
Visual Basic 6.0
RPG on the AS/400 mainframe
Learning Delphi 7

Contact Information

E-mail:
Click here to e-mail me
Website URL:
Website URL  http://evildzsmartcodez.t83.net/#/welcome/4542865755
Skype:
Skype  EvilD81
LinkedIn:
http://www.linkedin.com/profile/view?id=198295007&trk=tab_pro
Facebook:
http://www.facebook.com/profile.php?id=100000103325168

Comments

Toadill has no profile comments yet. Why not say hello?