Any advice for a good prefab workflow?

Options
rymdbolt
rymdbolt
edited November 2018 in Photon Bolt
I currently have two different views for one player, first person (entity.isOwner) and third person (!entity.isOwner). (All client auth here)

When I started out, I simply added the differences between these in Attached(), i.e. the camera which should only exist for the owner.

But as I add more features to my project, as you may imagine, this makes it very hard to configure each prefab (this entity needs a camera, this one needs a mouse look script, this one needs a third person body etc.).

What I want to do is to have a prefab that I can edit in the scene without having to add stuff when it gets attached. I want one prefab for entity.isOwner and one for !entity.isOwner, if that makes sense. But if I instantiate the prefabs on my own, Attached() won't get called.

Any tips on the workflow here?

Comments

  • stanchion
    Options

    You can use different prefabs for one entity depending if owner or not owner with pooling. See pooling doc https://goo.gl/GjBg5a

    For third and first person camera you can have this present in the scene and have your local player tell it to act as a camera for the entity.
  • rymdbolt
    Options
    Thanks, I'll try it!

    Are there any other examples out there where pooling is used? Like in the SamplePack or the Asset store tutorials?
  • stanchion
    Options
    There will be examples in the Sample Pack.
  • rymdbolt
    Options
    Sweet!

    By the way, how do I buy the Sample Pack?

    I noticed that you submitted it to the Asset Store but I can't find it there.

    On Discord it says "Email developer@photonengine.com asking for sample pack with your invoice." but I don't have an invoice (yet).
  • stanchion
    Options
    It will be on the asset store soon, you will have to wait a short time.
  • rymdbolt
    Options
    Alright. Thanks for the help!