Raycast/Particle Emitter Problem

EDIT: I now get the particles spraying but! My problem right now is that the ray seems to collide with the floor's collider so that when you try shooting in front of you it just sprays at your feet. Help?

I'm not really sure how to describe this problem and it has probably been answered before but...

function Fire () {

    var layerMask = 1 << 8;
    layerMask = ~layerMask;

    var hit : RaycastHit;
    var direction = mytrans.TransformDirection(Vector3.forward);

    if (Physics.Raycast (mytrans.position, direction, hit, range,layerMask))    

        if (hitParticles) 
            networkView.RPC("StartEmitting",RPCMode.Others,false, hit.point, hit.normal); 

This is my function for firing the gun, which calls the StartEmitting function:

function StartEmitting(shotOwner : boolean, hitPoint : Vector3, hitNormal : Vector3){
            Network.Instantiate(hitParticles, hitPoint, Quaternion.FromToRotation(Vector3.up, hitNormal), 0);

But the particles won't emit at all. This is pretty much butchered code from the FPS Tut/M2H networking tut but the funny thing is it worked perfectly until I tried to implement the RPC call.

Any help is very much appreciated, thanks.

Well, you never set "hit" variable to anything so it's always default value! You need to use it with Physics.Raycast!

// You forgot this bugger  v
if ( Physics.Raycast (ray, hit, range ) )

The follow up question asked by SeruK is found here.

Solved it by adding a blank Game Object as suggested by Statement. Mucho gracias!