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 /
  • Help Room /
avatar image
0
Question by rehaanpunjabi · Jan 11, 2020 at 09:42 AM · transformphotonpun

Photon transform view not syncing despite other objects transform view working perfectly

So Im making a little multiplayer game using photon pun, I'm new to photon but everything is quite simple. A player gets spawned in via a 'player spawner' GameObject which has this script attached to it:

 using Cinemachine;
 using Photon.Pun;
 using UnityEngine;
 
 namespace Photon
 {
     public class PlayerSpawner : MonoBehaviour
     {
         [SerializeField] private GameObject playerPrefab = null;
         [SerializeField] private Transform playerCamera = null;
 
         private void Start()
         {
             var player = PhotonNetwork.Instantiate(playerPrefab.name, Vector3.zero, Quaternion.identity);
 
             playerCamera.SetParent(player.transform); //This stuff just sets up some fields
             playerCamera.GetComponent<PlayerLook>().playerBody = player.transform;
             playerCamera.GetComponent<PlayerLook>().weaponBody = player.transform.Find("Weapon");
         }
     }
 }
 

It spawns in both players and the players both have transform views, again really simple. I literally just dragged in the rigidbody and transform of the player into the photon transform.

When running, the other player just falls out of the map and its transform isn't synced. The position fluctuates from around -750 to -1000. The player can spawn bullets as well, which works just fine, and that transform is synced between the two clients. So I don't understand what is happening since the bullet has the same transform sync. What's even weirder is this happened randomly, it used to work completely fine. It happen when I was doing something else and I'm not sure how to fix it. I would really appreciate any ideas. Here is a screenshot of the bullets (the blue things ) working any the other player falling out of the world .

![alt text][1]

Sorry if this was confusing and complicated and thanks for any help. I have been stuck on this for a while. I also already checked out other questions but If I missed someone with a similar problem to mine, please link it. Thanks so much. ,So Im making a little multiplayer game using photon pun, I'm new to photon but everything is quite simple. A player gets spawned in via a 'player spawner' gameobject which has this script attached to it:

 using Cinemachine;
 using Photon.Pun;
 using UnityEngine;
 
 namespace Photon
 {
     public class PlayerSpawner : MonoBehaviour
     {
         [SerializeField] private GameObject playerPrefab = null;
         [SerializeField] private Transform playerCamera = null;
 
         private void Start()
         {
             var player = PhotonNetwork.Instantiate(playerPrefab.name, Vector3.zero, Quaternion.identity);
 
             playerCamera.SetParent(player.transform); //This stuff just sets up some fields
             playerCamera.GetComponent<PlayerLook>().playerBody = player.transform;
             playerCamera.GetComponent<PlayerLook>().weaponBody = player.transform.Find("Weapon");
         }
     }
 }
 

It spawns in both players and the players both have transform views, again really simple. I literally just dragged in the rigidbody and transform of the player into the photon transform.

When running, the other player just falls out of the map and its transform isn't synced. The position fluctuates from around -750 to -1000. The player can spawn bullets as well, which works just fine, and that transform is synced between the two clients. So I don't understand what is happening since the bullet has the same transform sync. Whats even weirder is this happened randomly, it used to work completely fine. It happen when I was doing something else and I'm not sure how to fix it. I would really appreciate any ideas. At the bottom is a screenshot of the bullets (the blue things ) working any the other player falling out of the world .

Sorry if this was confusing and complicated and thanks for any help. I have been stuck on this for a while. I also already checked out other questions but If I missed someone with a similar problem to mine, please link it. Thanks so much.

optimized-screen-shot-2020-01-10-at-203936.jpg (332.4 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by rehaanpunjabi · Jan 11, 2020 at 08:28 AM

WOW I'm stupid. I just forgot to add the photon transform view to each child (the weapon and the body mesh). If anyone is having that problem check the children have the photon transform view already.

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 pythonista3h · Jan 26 at 04:21 PM 0
Share

So, I need to add Photon Transform View to each child?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

229 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 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 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 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 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 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 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

PhotonUnity player move object problem ! 1 Answer

Racing game using PUN 2 0 Answers

Synchronize an INT through Photon Pun2 0 Answers

I keep getting this error: Assets/Photon/PhotonRealtime/Code/Room.cs(309,42): error CS0115: `Photon.Realtime.Room.InternalCacheProperties()' is marked as an override but no suitable method found to override 0 Answers

hello guys please help !! I want to make a live Scene with Photon (PUN 2) I want my gamplay run 24h on server (Like Gambling Game) 0 Answers


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