Spawning, GO.setActive and changing transform parent
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Fusion.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Spawning, GO.setActive and changing transform parent
abacus_egon
2023-01-06 17:39:03
Hello! I have a very specific use case that I already tried some strange solutions but none worked :/
I need to:
Spawn an asset (a collectible)
This spawns as a child of a "breakable" object (transform.child)
And needs to be inactive, and the break interaction will activate it (gameobject.setactive)
The problem is that only the spawning of the above steps are actually working remotely... I've tried the OnBeforeSpawn and it does work for some things, but not for changing parent nor getting the object active or de-active
The object has NetworkTransform
, NetworkObject .
I am running a Shared
Architecture
BONUS: I needed to add a new behaviour to some objects, I ended up changing the behavior and only initializing the ones I needed... Is is possible to add a networkBehaviour to some Network objects?