Photon Destroying Object

Options
Hello Everyone,

I am trying to make photon destroy and delete an object of the scene.
i used this code :

PhotonView.Destroy(gameObject);

but then i get this error :

OnDestroy for PhotonView View (0)4039 on Bullet(Clone) but GO is still in instantiatedObjects. instantiationId: 4039. Use PhotonNetwork.Destroy(). Identical with this: True PN.Destroyed called for this PV: True
UnityEngine.Debug:LogWarning(Object)
PhotonView:OnDestroy() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs:217)

and that leads to this comment :

Debug.LogWarning(string.Format("OnDestroy for PhotonView {0} but GO is still in instantiatedObjects. instantiationId: {1}. Use PhotonNetwork.Destroy(). {2} Identical with this: {3} PN.Destroyed called for this PV: {4}", this, this.instantiationId, Application.isLoadingLevel ? "Loading new scene caused this." : "", instanceIsThisOne, destroyedByPhotonNetworkOrQuit));


does anyone know how to fix this?

Comments

  • Tobias
    Options
    You should use PhotonNetwork.Destroy() not PhotonView.Destroy(). Then it should work.
  • Thanks it worked like a charm!

    IS there a way to use Mechanim in unity network?
    I have the feeling that mechanim is Unity version only.
    SO i can see my animation, but you can only see your own.
    Am i right? or is there a way to do it without using Animator?

    The reason is, i have an upper body and a lower body and i can't split those in an Animator.
  • Tobias
    Options
    Mechnim just drives the animations but maybe several dozen of them per Character. You don't want to sync all those. You just want to show what actions a player did and based on that you can also trigger animations. Simple sample: You press "forward" and animate locally, blending animations. Instead of sending "forward" and all animation states, just send "forward" and let the receiving player animate based on that info.

    Animator might be more straight forward, as it does not infer the animation from movement or input itself.
    Mechanim is "Unity version only"? What do you mean?
  • Sorry for my late reaction..
    thought i would get a message when someone reacted to my posts

    With "unity version only" i ment to say,
    When you are running Unity, that's your unity version, your .exe. that is not mine.
    So thats your "Unity Version Only", i don't see what your doing.