Simple LOCAL instantiations proving impossible

Options
Hi there,

I have a script, and when a player gets shot, it should instantiate a GUITexture for each shot (blood splat) that slowly fades and destroys itself. However, I get yelled at for attempting to use Instantiate, but why the hell would I need to use PhotonNetwork for instantiating a local-only object?

I'm a bit lost on what to do here, thanks for any help!

Comments

  • dreamora
    Options
    Sure photon yells at you that you don't by error try to use the normal instantiate like the photon one which means that you by error provide it a string name of a prefab instead of providing it the prefab or a resource loaded from resources using the string?
  • 2Kin
    Options
    Can you post some code ?
  • Befall
    Options
    I eventually figured it out, just today. With my GameObject.Instantiate, I wasn't using Resources.Load("asset"), which is what PhotonNetwork was complaining about. After I did it that way, and made sure to NOT use PhotonNetwork.Destroy(), it worked out fine. Another similar issue was resolved, just had to fix network view checks based on ownership. Thanks though. :)
  • dreamora
    Options
    Thats what I was talking about :)
    Photon uses the string as it can not send around the resource, it can only send around the string it uses to instantiate it.
    But if you do it yourself you either have to use Resources.Load or alternatively, you can add a GameObject reference to the class and then just do an Instantiate(someGameObjectRef) to instantiate a prefab or clone an existing game object