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 tavi3053 · Jul 06, 2018 at 12:43 AM · shadermultiplayermultiplayer-networkingmultiplayer networking

Multiplayer - simple example with no collider

I am trying to get this simple multiplayer example working . Each player will see their own score in the top left and the opponents score in the top right. if they press '1' they will decrease the opponents score, if they press 2 they will increase their own score.

alt text

The two specific problems I have: 1. All the examples I have seen would have player 1 score on the left and player 2 score on the right. ie the server has a world view that all players see (I want player 2 to see their score on the left) 2. I cannot get the logic to get the other players score to decrease, as the only mechanism I understand to pass that information between the clients is for the client to detect a collision with an object (ie bullet) spawned by the other client.

I have looked through a number of good tutorials that show how to create a simple lobby, spawn players etc. All the easy to follow examples, however, have a physical representation of the player on the screen which produces a projectile, which causes damage to the other player when they detect a collision. The problem I have is that I have none of those things and I just can't figure out what to do!

unit-t.png (10.1 kB)
unit-t.png (10.1 kB)
Comment
Add comment · Show 4
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 NoDumbQuestion · Jul 06, 2018 at 01:43 AM 0
Share

Time to relearn unity

https://unity3d.com/learn/tutorials/s/multiplayer-networking?_ga=2.886834.266461329.1530668500-1470217311.1530668500

It just a matter of sending and receive package of data. One player send message to other player. They receive the message and do something. As a matter of code, you gotta learn

avatar image tavi3053 · Jul 06, 2018 at 02:08 AM 0
Share

@NoDumbQuestion thanks for the comment and link. I have looked at that multiplayer example and it does not cover what I am looking for. The message passing between the two clients is through an intermediate object that can be detected as colliding by the client who is taking the damage. In my example client1 pressing a button does not spawn an object, and as far as I can see UNET does not have any way of directly passing messages between clients.

avatar image NoDumbQuestion tavi3053 · Jul 06, 2018 at 02:17 AM 0
Share

How about using for standard network solution like Photon PUN. It is peer-cloud-peer.

It have 2 feature:

  1. Sync data: anytype of basic data like float, int , vector3

  2. Event(RPC): you can just send event call other player to increase their score or yourown score.

Edit: Everything is controlled by client. Nothing is control by server so this might be the best solution for you.

Pretty much simple since there was only 2 main function of network.

avatar image tavi3053 NoDumbQuestion · Jul 06, 2018 at 02:23 AM 0
Share

@NoDumbQuestion Thanks once again. I haven't looked at Photon PUN yet, I have been just slogging through Unet hoping to get the result I want. What you describes sounds exactly like what I need, no server control to complicate things. I will start looking into it and report back here (in a few days) if I have success.

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

195 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

Related Questions

Remove players and close server in Unity Multiplayer Game 0 Answers

UNET Networking: Changing Players texture 0 Answers

PUN - Choose random Hero for player 0 Answers

How to display IPv4 Address in game 0 Answers

Bullets Only Spawning on Host Client... (a uNet problem),Multiplayer Connected Client Not Spawning Bullets, But Host the is... 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