I’m trying to make a fps game (multiplayer of course) and I’m trying to make a gun. I tried with the normal Instantiate(bulletPrefab, blahblahblah) but it didn’t show up on the other clients. So I tried Network.Instantiate and it said this
Assets/shoot.js(11,43): BCE0017: The best overload for the method ‘UnityEngine.Network.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion, int)’ is not compatible with the argument list ‘(UnityEngine.Transform, UnityEngine.Vector3, UnityEngine.Quaternion)’.
Here’s the script
var bulletPrefab : Transform;
var bulletSpeed : float = 600;
function Update ()
{
if(Input.GetButtonDown("Fire1"))
{
if (!bulletPrefab || !bulletSpeed)
{
} else {
var bulletCreate = Network.Instantiate(bulletPrefab,GameObject.Find("SpawnPoint").transform.position,Quaternion.identity);
bulletCreate.rigidbody.AddForce(transform.forward * bulletSpeed);
}
}
}