fix(trol): War Totem ghost invisible everywhere
The totem borrowed its look from the GoblinTotem item, whose root holds a ParticleSystem while the mesh sits in its attach child. Player.SetupPlacementGhost switches off every GameObject with a ParticleSystem, so it took the root and the mesh with it: the F8 dump showed TotemModel/model/attach/model active=False on the ghost. The Yagluth head (TrophyGoblinKing) is built the same way. Both now borrow the item's attach child, which is the mesh itself. ModelBorrow switches the copy on, since an item's attach is stored inactive in its prefab.
This commit is contained in:
parent
edc7fd33b7
commit
e1bd3b66e1
2 changed files with 22 additions and 2 deletions
|
|
@ -89,6 +89,11 @@ namespace RacesOfValheim
|
|||
copy.transform.localRotation = localRotation;
|
||||
copy.transform.localScale = Vector3.one;
|
||||
|
||||
// An item's "attach" child is stored switched off in its prefab (VisEquipment turns it on
|
||||
// when it is worn), so a copy of one comes out switched off too. The holder above is still
|
||||
// inactive, so turning the copy on wakes nothing.
|
||||
if (!copy.activeSelf) copy.SetActive(true);
|
||||
|
||||
// Everything that is not a Renderer or a Transform. Order matters for the same reason it did
|
||||
// on the Aswid's lights: behaviours first, then the things they hold references to.
|
||||
foreach (MonoBehaviour behaviour in copy.GetComponentsInChildren<MonoBehaviour>(true))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue