How to add an component to PhotonView.observedComponent in script?

Hi,
how should i add a component in the script to photon view
observedcomponent

Hi,

you can use photonView.ObservedComponents.Add(component); for this. The better way however might be to do this in the editor’s inspector.

Thankyou for your respond.
I tried but still getting error .
the problem is i need to add a component when the game is running.

Assets/Scripts/CreatingCollider.js(54,111): BCE0017: The best overload for the method ‘System.Collections.Generic.List…Add(UnityEngine.Component)’ is not compatible with the argument list ‘(System.Type)’.