SFS Networked Bullets

Hi there,
I’m new to unity and i’ve just started attempting to build a simple 3rd person shooter using the Smart Fox Server API ‘Islands’ demo by Thomas Lund.

At the moment the local player has the abilities to fire projectile prefabs from a weapon, the way I want it to work is to have all the information regarding the new spawned projectile to be sent to the server so that the remote player can spawn that bullet from the same place, on the same velocity.

I’ve written up some pseudo-code to try and express better what i’m needing help with…
some of the things i’ve used here are real SFS functions that I’ve noticed being used in the demo, but its mostly plain english;

here’s my pseudo-code so far…

WEAPON_LOCAL:

...

function Fire () {
	if (Time.time > reloadTime + lastShot) {
		// create a new projectile, use the same position and rotation as the gun.
		var instantiatedProjectile : Rigidbody = Instantiate (projectile, transform.position, transform.rotation);
			
		// Give it an initial forward velocity.
		instantiatedProjectile.velocity = transform.TransformDirection(Vector3 (0, 0, initialSpeed));


		Physics.IgnoreCollision(instantiatedProjectile.collider, transform.root.collider);
		
		lastShot = Time.time;
		//ammoCount--;
	}
}

function Update () {
	if( Input.GetButton( "Fire1" ) ) {
		Fire ();
	}
}

this is just to make the local player fire local bullets

SHOT_SENDER:

...
using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;

public class NetworkShotSender : MonoBehaviour 
{

private NetworkShot shot;

void Update()
{
	if( Input.GetButtonDown( "Fire1" ) )
	{

	shot = new NetworkShot(playerid, instantiatedProjectile.position, instantiatedProjectile.rotation, instantiatedProjectile.velocity);
	shot.DoSend();
	}
    }
}

this is to send the position and velocity used to make those local bullets to the server simultaneously so that it can spawn the same bullets on other clients.

WEAPON_REMOTE:

...

using SmartFoxClientAPI;
using SmartFoxClientAPI.Data;

public class NetworkShotReceiver2 : MonoBehaviour {

private Rigidbody projectile;


void StartReceiving() {
	receiveMode = true;
}


void Update()
{
}


	void ReceiveShot(SFSObject data) {
		if (receiveMode) {
			if(shoot message recieved from SFS for this player)
			{
				public Rigidbody instantiatedProjectile = Instantiate(projectile, data.GetNumber("bullet_position"), data.GetNumber("bullet_rotation") );
				instantiatedProjectile.velocity = data.GetNumber("bullet_velocity");
				Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider ); //dont let bullets hit and kill the player that fired them
			}
		}
	}
	
	}

and this is to go on the remote player, which i want to spawn and fire off bullets from other players.

Any help would be much appreciated,
feel free to correct me on my entire approach here, remember that I’m mostly guessing as to what I’m doing :S
Thanks

come on guys, none of you know anything about using smarterfox with unity??

Personally I’m not too familiar with it, but you may want to post this in Unity Networking as opposed to Scripting. You are more likely to get people more familiar with SmartFox.