x


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!

more ▼

asked Jan 07 '11 at 04:41 PM

Henrique gravatar image

Henrique
93 14 14 17

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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;
}
more ▼

answered Jan 07 '11 at 05:05 PM

PrimeDerektive gravatar image

PrimeDerektive
3.1k 57 64 84

Thank you, it works!

Jan 07 '11 at 08:13 PM Henrique

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.

Jan 07 '11 at 08:26 PM PrimeDerektive
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x733
x659
x330
x206

asked: Jan 07 '11 at 04:41 PM

Seen: 1051 times

Last Updated: Jan 07 '11 at 04:41 PM