x


RPC activate object

hi i got a question i want to activate my fps weapon and deactivate all other weapons i can deactivate it for my self but the other network players can see all my weapons i think i can fix this by using rpc but i dont know hot do you guys know somthing

here some part of my code ( i know its wrong just somthing i tryed)


@RPC
function W1 (){
networkView.RPC ("W1", RPCMode.All, PrimarySlot.gameObject.SetActiveRecursively(true);
networkView.RPC ("W1", RPCMode.All, SecondarySlot.gameObject.SetActiveRecursively(false);
networkView.RPC ("W1", RPCMode.All, ThirdSlot.gameObject.SetActiveRecursively(false);
yield WaitForSeconds(WaitTime);
PrimarySelected = true;
SecondarySelected = false;
ThirdSelected = false;

WA1.animation.CrossFade(Gun1Up);

}
more ▼

asked Aug 02 '12 at 06:35 PM

DutchWarfare12 gravatar image

DutchWarfare12
15 5 6

i got it :)

Aug 03 '12 at 06:52 AM DutchWarfare12

You could post the answer yourself and help others.

Aug 08 '12 at 10:06 AM tobiass

ok i placed the activate stuff ( PrimarySlot.gameObject.SetActiveRecursively(true); )

in an new function

and the ware i press button (1) then i call an RPC

networkView.RPC ("new function", RPCMode.All)

then it works

( srry for my english )

Aug 08 '12 at 11:56 AM DutchWarfare12
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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:

x702
x683
x380
x237

asked: Aug 02 '12 at 06:35 PM

Seen: 251 times

Last Updated: Aug 08 '12 at 11:56 AM