No overload for method 'Destroy' takes 2 arguments
Options
N1warhead
✭✭
I'm sorry I keep asking so many questions, I am new to Networking and stuff, it's a whole other world compared to normal
game programming to create a game.......
The bullets instantiate in the scene (no force added to them yet) there was force to move projectile forward, but now that stopped working....
But one step at a time,
(1) Bullets - DO INSTANTIATE OVER NETWORK.
(2) THEY DO DESTROY - IF I USE NORMAL DESTROY(this.gameObject);
(3) But I get the error below if I use PhotonNetwork.Destroy().......
Okay, well, here is my ERROR for PhotonNetwork.Destroy();
Here is my Bullet Collision Script.
game programming to create a game.......
The bullets instantiate in the scene (no force added to them yet) there was force to move projectile forward, but now that stopped working....
But one step at a time,
(1) Bullets - DO INSTANTIATE OVER NETWORK.
(2) THEY DO DESTROY - IF I USE NORMAL DESTROY(this.gameObject);
(3) But I get the error below if I use PhotonNetwork.Destroy().......
Okay, well, here is my ERROR for PhotonNetwork.Destroy();
Assets/Scripts/Ak47Collision.cs(23,31): error CS1501: No overload for method `Destroy' takes `2' arguments
Here is my Bullet Collision Script.
using UnityEngine; using System.Collections; public class Ak47Collision : MonoBehaviour { // DOCUMENTATION ON AK47 COLLISION *** // // // BE SURE THIS SCRIPT AND BULLET DAMAGE ARE PROPERLY PUT ON // EACH NEW PROJECTILE. // THIS SCRIPT DEALS ONLY WITH // (DESTROYING THE PROJECTILE ON IMPACT +++++ // PARTICLES AND OR BULLETHOLES FOR IMPACT // // // END OF DOCUMENTATION *** void Start(){ // IF BULLET HITS NOTHING WITHIN 2.5 Seconds, it will destroy Bullet. PhotonNetwork.Destroy (this.gameObject, 2.5f); } void OnCollisionEnter(Collision col){ // If the Projectile hits an object with the name ("MAP") It will Destroy the bullet. if (col.gameObject.name == "Map") { Debug.Log ("BulletDestroyed"); PhotonNetwork.Destroy (this.gameObject); // IF BULLET HITS ANY OBJECT WITH THE ((((***TAG***)))) - (PLAYER) IT WILL DESTROY BULLET. } else if (col.gameObject.tag == "Player") Debug.Log ("Player Shot - AK47"); PhotonNetwork.Destroy (this.gameObject); } }
0
Comments
-
SOLVED!!!!
I figured it out, at least, so it appears! lol.
For anyone who ever has the same issue here is the script guys!using UnityEngine; using System.Collections; public class Ak47Collision : MonoBehaviour { public float BulletLife = 0f; // DOCUMENTATION ON AK47 COLLISION *** // // // BE SURE THIS SCRIPT AND BULLET DAMAGE ARE PROPERLY PUT ON // EACH NEW PROJECTILE. // THIS SCRIPT DEALS ONLY WITH // (DESTROYING THE PROJECTILE ON IMPACT +++++ // PARTICLES AND OR BULLETHOLES FOR IMPACT // // // END OF DOCUMENTATION *** void Awake(){ BulletLife = Time.time; } void Update(){ // IF BULLET HITS NOTHING WITHIN 2.5 Seconds, it will destroy Bullet. if (Time.time - BulletLife > 2f) { //Destroy (this.gameObject); PhotonNetwork.Destroy (this.gameObject); Debug.Log ("Bullet Destroyed Before Shooting"); } }
0