• 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 post has been wikified, any user with enough reputation can edit it.
avatar image
Question by Michel Verheughe · Mar 19, 2014 at 01:41 PM · networkingserverclient

Networking slow game objects

I have gone through several networking tutorials but it looks like they all do the same thing: Clients send their keyboard or mouse instructions to the Server that moves objects.

In my case, I want to simulate real ships that move extremely slowly and I only want the Server to be a "stupid" .exe file that reads up to five clients and send their Transform (Position and Rotation) the all the others.

Can you help me with the codes I need to write? I already have the initialization of the Server, contact with Clients, instantiating of a Prefab when a Client connects but what do I send to the Server and how. Thank you in advance.

Comment

People who like this

0 Show 8
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 ShadoX · Mar 19, 2014 at 04:36 PM 0
Share

I'm not sure where the problem is, as far as I understand the problem is that you haven't really figured out how to handle the communication between server and client.

I don't really see why it would be that hard to check what buttons a client is pressing and send that info + additional info to the server.

example: Client 1 uses W key > send to server that that Client 1 is using W key > server sends info to other clients > other clients act accordingly (like move the ship)

Don't really see where the problem is :|

avatar image Michel Verheughe · Mar 19, 2014 at 09:49 PM 0
Share

Thank you for your answer. I use this tutorial: http://www.paladinstudios.com/2013/07/10/how-to-create-an-online-multiplayer-game-with-unity/ which is excellent but it works the scene on the server and I only want to send position and rotation of the clients to each other. I don't understand how to address the different clients from the server side. Thanks in advance.

avatar image ShadoX · Mar 19, 2014 at 11:16 PM 0
Share

My bad, I haven't used that method for networking.. I had a look at the finished project which you can download from that site and by the looks of it , the guy is using some built in unity functions which basically take care of all the networking stuff for you.

Usually the idea would be to keep a list of all the clients on the server and just go through that list and send data to each 1 of them. (which is hidden in that tutorial behind built in stuff)

You could try searching around and/or have a look at http://answers.unity3d.com/questions/37349/rpc-calls-to-a-specific-client.html if you're interested in sending data to a specific client.

Try searching around more if you're interested in how all the networking stuff usually works (clients connecting to server, client/server communication etc..)

avatar image Michel Verheughe · Mar 20, 2014 at 07:50 AM 0
Share

Thank you, my friend. To be understood is already helping since I am 66 years old and getting senile ;-) This project is my last one before I retire and while networking has nothing to do with my position of art director, I wish I could offer my employer something to be remember by! ;-) I will continue my quest for a simple client-server communication. I can model ships, radars, etc. but I am not good at object-oriented programming because then, I have to adapt my logic to someone else's logic! ;-)

avatar image ShadoX · Mar 20, 2014 at 01:44 PM 0
Share

I don't think that it gets much simpler than this in terms of amount of code. All the network logic is hidden so you basically have to write the base of your game and apparently only a couple of additional lines to have all those commands sent/executed between server and clients.

Or were you looking for more control over what is happening on the network ?

Either way, I could try to help out if you want, so feel free PM me

Show more comments

0 Replies

  • Sort: 

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

22 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

Related Questions

Unity networking tutorial? 6 Answers

How to send a message to the server 1 Answer

How do you network an object to be a child of another object (so that it shows up in the hierarchy) in both the client and server? 0 Answers

Networking Question 1 Answer

How can I sync rigid bodies over a network? 2 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