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
1
Question by ProgramacionWH · Sep 07, 2016 at 12:28 AM · javascriptnetworkinginstantiatelag

Big Delay in Networking

Hi there, I am not sure how to explain this: I am working on a 2D shooter, and when playing in Internet the delay is kind of big (0.5 secs maybe), sometimes this delay makes the shoot hit the own shooter (Shoot is spawned from server) but this is not the problem I mean this shouldnt happen with a normal delay, when I play in LAN delay is correct , what makes sense because it is localhost, when I play with Internet even with myself delays is > 0.5 as said.

Shoot code (Shoot Objects has a 3D rigidbody):

     @Command
     public function CmdShoot() {
         var shoot = Instantiate(ShootGO,ShootPoint.position,gameObject.transform.rotation);
         NetworkServer.Spawn(shoot);
         shoot.GetComponent.<Rigidbody>().AddRelativeForce(Vector3.forward * 500);
         shoot.name = "Shoot";
         var audio : AudioSource = GetComponent.<AudioSource>();
         audio.PlayClipAtPoint(ShootAudio,gameObject.transform.position);
     }

Also I have done a adsl test: 20 Mgbs Also pinged Unity servers: 41 medium of ping

So I am kind of confused, Unity servers looks like working correctly, game itself is working as it works in lan as expected, so... Maybe some configuration is using too much bandwitch?

Network Sendrate: 15 (Tested 30 too and problem kept)

Shoot Network Transform:

  • Sendrate: (I need maximum real time, maybe this can cause the lag? if i put this less than 29 projectiles dont go fluid...)

  • Tranform Type: Rigidbody 3D

  • Movement threshold : 0,001

  • Threshold snap: 5

  • Interpolate Movement: 1

  • Rotation Axis: None

  • Rest ones as default

Shoot are destroyed after hitting a wall/enemy so I would say max shoot objects at same time ~= 8.

I dont know if you need more information. I have tried different configurations for 2 days, different ideas and nothing is working with a understandly delay.

Thanks in advance.

Comment
Add comment · Show 2
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 Cynikal ♦ · Sep 07, 2016 at 02:00 AM 0
Share

The delay is most likely due to your setup.

Do you have Run in background turned on?

How are you testing? a build and the unity editor?

Did you try two computers?

avatar image ProgramacionWH Cynikal ♦ · Sep 07, 2016 at 03:11 AM 0
Share

Not running in bg. Have tested in lan with 2 applications + 1Unity and in Internet with 1 Unity + 1 application. Also tested with another computer of my home 1 app here + 1 app there and also tested with friends (Where I am not sure but problems look smaller)

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

Unity Frame Drop From Instantiating Prefab that has script 0 Answers

how can I present a choice under function OnNetworkLoadedLevel 2 Answers

Problem with Random.range 1 Answer

BCE0049 error with networking script 0 Answers

Fireball instantiate - lags 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