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 Chom1czek · Oct 19, 2015 at 12:47 PM · networkingnetworkparticlesparticlesystemsynchronize

Particles syncing on the Unity Network

Hello there, I've got a trouble to sync particles in Unity Network system. How can I see it on client when emitting them on host and so on? Any ideas and solution are appreciated please :)

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by tcz8 · Sep 13, 2020 at 08:32 PM

I'm going to answer this question for posterity.

Like everything else in Unity, particles wont sync over the network just because you want them to (some "network enabled" components do but they are rare and deprecated with the old UNET). So, when you press "F" to emit your particles, you need to send a signal over the network to tell the "other side" to fire a particle.

In "pseudo code" you have to do something like this:

 void EmitParticle() {
     particleSystem.Emit();  // Launch your particle as usual
 
     If (isOnlineGame) {       // Tell network clients to launch particles
          SendNetworkEventToEmitParticles();
     }
 }


Unfortunatly I can't be clearer about SendNetworkEventToEmitParticles() cause it changes depending on which multiplayer solution you are using (Unet, Bolt, ForgeNetworking, etc.) and how you implemented it in your game.

On the remote side of the connection you also need to have code in place to receive those network messages, interpret them and then act accordingly. In this case, emit particles (taking care not to send them again on the network or you will end up with an endless loop). This is pretty much the same for everything you want to sync over the network, firing a weapon, changing the weather, loading a map, changing which song is playing, etc.

Also, to be clear, the idea is not to replicate every single particle over the network but only to tell remote entities to fire their particles when needed. ie.: When dealing with bullets you can include in your message extra info like the target that was hit so you can properly "orient" your particle system before firing but beside that don't try to make it perfect. Remember that a game is all smokes and mirrors and over the network there is A LOT of smoke. FYI in this "bullet" case, synchronized bullets should never apply damage, it is only there for the show. Applying actual damage should be processed locally (like in a single player game) and then you send a damage event over the network.

Implementing multiplayer is one of the most complex part of game development. This is not the time to skip the manual. This is coming form a guy that doesn't like to RTFM. If you don't do it all you are doing is wasting your time and will end up rewriting your implementation multiple times before it starts working "semi" correctly and even then you will end up in the manual.

Good luck!

Comment
Add comment · 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
0

Answer by karl_jones · Oct 19, 2015 at 12:58 PM

You should have a ParticleSystem on both sides, then If you want to ensure that both sides see the same particle effect set the random seed to be the same (none zero) value on all clients. http://docs.unity3d.com/ScriptReference/ParticleSystem-randomSeed.html.

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 Chom1czek · Oct 19, 2015 at 01:03 PM 0
Share

I've got ParticleSystem on both sides. I've created a GameObject child on my PlayerPrefab called Emitter and it has ParticleSystem attached to it. OnStartLocalPlayer I SetActive(true) to the Emitter and I'm using F key to Emit one particle for a test and it works only for LocalPlayer, on the other side I don't see it being emited. I want to use particles as projectiles, is it possible? And do I need to have them attached all the time to see it being emitted on the other player? Because I want to add particle emitter only to those players who "learn" it.

avatar image
0

Answer by Chom1czek · Oct 19, 2015 at 03:58 PM

Bump anyone? Particles only work when they are set "Play On Awake" but when I want to emit it runtime it doesn't work so I guess I must emit it wrong. I am using

 void Update()
 {
  if(isLocalPlayer)
  {
    if(Input.GetKeyDown(Keycode.F))
    {
      particleSystem.Emit(1);
    }
  }
 }

I think it must be a problem but how to do it so that clients can see it?

Comment
Add comment · 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
0

Answer by OJazem · Apr 10, 2018 at 01:34 PM

Hey bro. did you manage to get it work? I am stuck with the same issue.

Comment
Add comment · 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

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

40 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

Related Questions

How do i spawn particles over network for everyone too see in UNET? 1 Answer

particle collision events networking 0 Answers

Lerping to Smooth Network Movement 0 Answers

Photon Weapon synchronize View Help Please 0 Answers

Need some help with networking, Object reference not set to an instance of an object. 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