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 /
avatar image
0
Question by DivinityStripes · Apr 19, 2016 at 05:00 AM · networkingpositionobjectclient-serversynchronizing

UNet Portal 2 Like Object Interaction Client to Server

Hello. I'm working on a 3D puzzle platformer cooperative game much like Portal 2 using UNet 5.3.2f1. I have reached a point in development where I need to sync a player picking up and moving around an object across the client and server. However, this functionality has become a huge roadblock as I have been tackling it for the past couple of days without success.

Currently, when the host picks up an object, it works perfectly as expected; the object moves and that is reflected across on the client side. Here's links to gifs of:

Host View Picking Up Object:

https://giphy.com/gifs/VEWsUVkkzKLmM

Client View Watching Host Pick Up Object:

https://giphy.com/gifs/S13UXAbsSDSEg

However, the problem comes in when the client tries to pick up an object. When they try to pick up an object, the changes are not synced to the host and the object's position is stuck where it is on the host. Here's links to gifs of:

Host View Watching Client Pick Up Object:

https://giphy.com/gifs/10YqdzU2MWx6Ao

Client View Picking Up Object:

https://giphy.com/gifs/WxgmxnhneQP0k

Here's my PickUpObject script on pastebin if that will be helpful: http://pastebin.com/Y5Se9Vft

Sorry that it's a bit messy and cluttered with comments. That was from hours of trying to get it to work.

How the scene is set up:

  1. The script above is attached to the root of the player objects that are being controlled

  2. The player objects have NetworkIdentities set to Local Player Authority and NetworkTransforms syncing Rigidbody 3D

  3. The object has a NetworkIdentity set to Local Player Authority and a NetworkTransform syncing Rigidbody3D

  4. The object IS NOT a Registered Spawnable Prefab. From my understanding of the UNet documentation, an object that exists in the scene with a NetworkIdentity attached to it is a Scene Object. This is spawned automatically by the NetworkManager after the scene loads with NetworkServer.SpawnObjects(). From this documentation.

My desired behavior is having the client pick up the object naturally and having those changes synced to the host. Just as you would expect from a game like Portal 2. I'd like to just be able to build scenes and levels by placing the objects around the level, like you would a single player level.

I have tried googling for hours only to meet dead ends and "solutions" that had no effect. It would be amazing if somebody could help me with this as I've been working on it for days yielding no results.

Thank you!

Comment
Add comment · Show 1
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 w4rPh3ous · Apr 10, 2017 at 01:01 PM 0
Share

Have you found a solution for this? I have pretty much the same issue.

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

sending commands from multiple clients 2 Answers

Unity Multiplayer (Mirror) - Problem in syncing game object's variables across all clients. [Trying to send command for object without authority] 0 Answers

Issuing orders to Units in Networked Turn-based game 0 Answers

Network Tutorial Interpolation - TPS Auth 0 Answers

UNET Bug with NetworkHash128 and Saving Prefabs 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