Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 27, 2016 at 09:58 AM by Magnomous for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Magnomous · Oct 19, 2015 at 01:10 PM · instantiatephoton

PhotonNetwork.Instantiate() doesn't work

Hello, sorry if I'm writing to wrong section, but anyway I can't instantiate player on network.

This is my script to connect:

 using UnityEngine;
 using System.Collections;
 
 public class NetworkManager : Photon.MonoBehaviour {
 
 public Transform respawn;
 
 private const string _VERSION = "1.0";
 
 void Start() {
 
 PhotonNetwork.autoJoinLobby = false;
 PhotonNetwork.ConnectUsingSettings(_VERSION);
 }
 
 public virtual void OnConnectedToMaster() {
 
 PhotonNetwork.JoinRandomRoom(); 
 }
 
 public void OnPhotonRandomJoinFailed() {
 
 PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 4 }, null);
 }
 
 public void OnJoinedRoom() {
 Debug.Log(Resources.Load("Player"));
 PhotonNetwork.Instantiate("Player", respawn.position, respawn.rotation, 0);
 }
 }
 

Using Debug.Log(Resources.Load("Player")); placed inside of OnJoinedRoom() I've found out that it locates Player. But it won't instantiate. Instead, it instantiates default Unity 3rd person controller. Any idea why?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by Magnomous · Mar 27, 2016 at 10:00 AM

I was instantiating prefab from Resources folder that was inside of Demo folder. So there were 2 Resources folders and it was instantiating from wrong one. Thank you for the answer anyway.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by danthebeliever · Mar 26, 2016 at 07:41 PM

Make sure your prefab has a PhotonView attached.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image METAZMUST · Dec 12, 2020 at 04:12 PM 0
Share

i made that but it doesntt work now too. İ wish u didnt give up from unity .

Follow this Question

Answers Answers and Comments

34 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Photon Instantiate Prefab Script Problems 0 Answers

PhotonNetwork.InstantiateSceneObject works in editor but not in build 2 Answers

Photon Instantiate Group's, Instantiating Prefabs that should already Exist 1 Answer

Multiplayer game, object instantiated is being added for every single player 1 Answer

Photon Network Instantiate Objects over Network 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges