0

I'm trying to instantiate a knife in my multiplayer game (using Photon). I need it to be a rigidbody, as I change its velocity and need gravity. Here's what I currently have (only error is 0039, opposed to 0029)

            Rigidbody knifeInstance;
            knifeInstance = PhotonNetwork.Instantiate(Knife.name, SpawnerPos.position, SpawnerPos.rotation) as Rigidbody;

            knifeInstance.velocity = new Vector3(-tempX * Speed * 4f, -tempY * Speed * 2.5f, -tempZ * Speed * 4f);

I of course have Photon.Pun added.

I've used "Instantiate( . . . ) as Rigidbody;" before, but now it doesn't work when I implement PhotonNetwork.Instantiate( . . . );

0 Answers0