- Home /
network effects
Hi, i have problems to make shoot effects. I have two networked games, aircraft and a simple fps. I gonna make them one game, but i must solve this little problem.
How do I make the shoot effects? (im using raycast shot) Before the networking programming, i was using a particle emmiter that uses "particlevar.Emit();" to control the emission when the player press "Fire1".
It doesn't working with networkView i added....
How to control a particle emitter networked, or any other ideas for shooting effects???? Thanks you so much!
Answer by PrimeDerektive · Jan 07, 2011 at 05:05 PM
You don't need a networkView on the particle emitter, just have one on the player, and have the particle emitter as a child of the player object (so the emitter exists on the player in all network instances of the game), and have a script on the player that sends an RPC to all connected players that he fired a shot.
Here's a basic example:
shotParticles : ParticleEmitter;
function Start(){ shotParticles.emit = false; }
function Update(){ if(Input.GetButtonUp("Fire1")){ networkView.RPC("EmitShotParticles", RPCMode.All); } }
@RPC function EmitShotParticles(){ ShotParticles.emit = true; }
No problem :) getting answers to networking questions around here is like pulling teeth, so I try to answer them as best I can when I see 'em. Try to use RPC's as much as possible, they rule hard.
Your answer
Follow this Question
Related Questions
Particles/Effects dont show in network 1 Answer
VFX Graph Texture Sheet Animation 2 Answers
Unitys Particle System wont work like i want 0 Answers
Creating a disintegration effect? 1 Answer
Particles for dreamy smoke-like effects and bubbles 2 Answers