Whats Wrong with my script, im kinda new to Photoncloud and the lack of documentation is staggering (finding documentation anyway) but thats not my main problem, Im making a very basic shooter using prefabshooting (the game is played with 6 players max so its not that straining) problem is the script doesnt seem to be working, what i want is for other players to be able to see the rigidbody bullet.
using UnityEngine;
using System.Collections;
public class ShootingPrefab : MonoBehaviour
{
public Rigidbody theBullet;
public float Speed = 200f;
PhotonView view;
// Use this for initialization
void Start()
{
view = GetComponent<PhotonView>();
}
void Update()
{
if (Input.GetMouseButtonDown(0))
{
var clone = PhotonNetwork.Instantiate("theBullet", transform.position, transform.rotation);
clone.velocity = transform.TransformDirection(Vector3(0, 0, Speed));
Destroy(clone.gameObject, 3);
}
}
}