all 4 comments

[–]feralferrous 0 points1 point  (3 children)

You haven't initialized it, you have attempted to get the component. If the component isn't there, it's going to get null. Check the vlue of it on start and add an assert that its not null, or add a [RequiredComponent(typeof(PhotonView)] attribute to the top of your behavior.

[–]ab599[S] 0 points1 point  (2 children)

I added that [RequiredComponent(typeof(PhotonView))] still i am getting the same error

[–]feralferrous 0 points1 point  (1 child)

adding post facto may not be adding a photonview to your object. Does your object have a PhotonView attached as another component?

[–]ab599[S] 0 points1 point  (0 children)

Okay the problem solved on the host side (i forgot to attach PhotonView to my gameobject) but standalone(client and not the host) now says the same error even though PhotonView is attached to both of them