Page 1 of 1

Unity with SFS problem

Posted: 28 Sep 2009, 04:50
by makelife
Hi!folks.
I have a problem.The remoteplayer insantiate a bullet,but the another player can't see the bullet.Who can tell me why?Please help me.How to do it
Thanks.

Posted: 28 Sep 2009, 12:29
by ThomasLund
We will need more information to be able to help you.

The island demo code only synchronizes player transform, animations and does chat. Did you extend the code to support the bullets?

If yes, then share the code please and say what kind of errors you get on e.g. the console.

Best
Thomas

Posted: 30 Sep 2009, 05:14
by makelife
Yes!there is no error.
Rigidbody remoteBullet = (Rigidbody)Instantiate(Bullet,pos,rot);
this code can instantiate the bullet.
but the following code cann't move the bullet.
remoteBullet.velocity = transform.TransformDirection (Vector3.forward * BulletSpeed);
Physics.IgnoreCollision(remoteBullet.collider, transform.root.collider);
I am so confused for it.
Please help me.Thomast :cry:

bob

Posted: 30 Sep 2009, 05:39
by ThomasLund
Hi Bob

This doesnt really sound much like a SFS question, but rather a general Unity one.

Some quick questions - how do you transport the "shoot" message over the network? Similar to the animation, so you basically tells the client that the enemy has pulled the trigger?

Or do you try to run physics over the network where you send the coordinates, velocity etc. of every bullet and try to sync them?

If its the first - are you certain the message arrives on the client? If your primary problem then is moving the bullet initially, then you need to look into AddForce/AddRelativeForce rather than trying to manipulate the velocity directly.

file:///Applications/Unity/Unity.app/Contents/Documentation/Documentation/ScriptReference/Rigidbody.AddRelativeForce.html


If its the latter, then you are on your own. It is my experience that you should _not_ try to run physics over the net. Period.

/Thomas

Posted: 30 Sep 2009, 06:34
by makelife
Hi!Thomas
Thanks for your reply.

But how to give trigger to the remoteplayer?

BOb