- Home /
Unet Sync Particle System
I've been playing around with the new Unet sample projects and the presentation demo. Most things seem to be working as advertised for now, I would definitely like to see more examples and hopefully tutorials and live learning sessions down the road to help me better learn and understand what's going on.
Anyway, my question is how to sync a player's particle system so it's visible to the other players? Example is the space shooter demo from the unity presentation, the 2D shooter game and the tank game. When a player thrusts his airplane he can see the particle system but other players can't.
In all these 3 sample projects, all code related to synchronizing the particle systems is incomplete and all commented out giving me no example of a working sample. Tried to tinker around with RPC and state synchronization with no luck.
Any help is much appreciated.
Well, basicly... you need to add a network identify and a network transform script to your particle. Put the Network Send rate to 0 and Sync Transform on the transform sync method in your NetWork Transform. The $$anonymous$$ost I$$anonymous$$PORTANT things is to put your particle prefab inside your Network$$anonymous$$anager in the SpawnInfo...!!!! :) Enjoy
Answer by MJ Z · Jul 14, 2015 at 04:35 PM
Thanks to Sean and Chris from this other thread we got it to finally work. Link for refernce: http://forum.unity3d.com/threads/sync-particle-system.339141/#post-2203316
Answer by meat5000 · Jul 13, 2015 at 11:20 AM
The particle system should be triggered locally on each client, connected to forward motion of the craft or something to that effect. This minimises pointless Network usage which would otherwise seriously spoil your game.
I get the concept but I'm not sure I understand how to go about doing this.
The thursters are on the ship, when you thrust you can only control your ship. You would expect any particle system attached to a player object to be shared automatically like the transform but they're not. And if you're not the player you can't control any others' thrusters for either visibility or audio. it's like a catch 22 and I'm sure we are missing something here or this is a bug.
Every client handles its own thrusters. Every client knows if the ship, player or enemy, is moving or not. If this were not the case the ships wouldnt move on the client. The network information for a forward movement has already been send. A forward movement implies the use of thrusters. Each ship detects its forward movement and fires its own thrusters. No syncing, no extra network data.
Yes and that's exactly why it's not working. The conundrum is every client can see other ships moving but unless it's "isLocalPlayer" you can't control it because only the local player can control his/her own ship. I tried what you mentioned, as in if a ship is not the local player but "Thrusting" is true then fire the particle system, it didn't work. I'm guessing because you can't control them. Perhaps a workaround would be to spawn local particle systems on all foreign ships and fire them locally when they're "Thrusting" but one would think there's gotta be an easier and more friendly way of doing this.
If it's a bug because of control authority then the only way this would work is if the particle systems are not part of the player or we have duplicates. I hate this idea lol
Your answer
Follow this Question
Related Questions
Why can Android send commands via NetworkManager but iOS cannot? 0 Answers
UNET LLAPI - Answering incoming connection 1 Answer
Interpolating Positions, Networking 0 Answers
UNET - Sync scene/objects that are not in the online scene? 0 Answers
[UNET] PlayerPrefab successfully spawns on Server, but Clients only see their own playerPrefab. 0 Answers