Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.3.8f1
Issue ID
1137960
Regression
No
EditorOnly Tag is ignored on Prefabs that are instantiated by code
How to reproduce:
1. Open the user-submitted project ("EditorOnlyBug.zip")
2. Build the project and observe the text objects
Expected result: the "EditorOnly" tagged text objects are not visible in the build
Actual result: The instantiated prefab text objects are not removed in the build even though they have the "EditorOnly" tag
Reproduced in: 2019.2.0a9, 2019.1.0b8, 2018.3.10f1, 2018.2.0f2
Comments (1)
-
Alejandro-Martinez-Chacin
Sep 30, 2021 16:58
Oh, just seriously got bit by this one.
Use case:
- Thousands of prefabs instantiated to create a level. These prefabs have particle systems, sounds, etc (self contained objects).
- Particle systems just for existing (even if not awoken and completely disabled) take a small memory footprint. This adds up to sometimes GBs of memory on particles that might never be played.Solution:
- Have a pool of particles to be reused for each of those previous instances when needed.
- For editing purposes, work with the particle systems inside the prefab for placement, sizing, etc... leave this particle system as EditorOnly as it will be instantiated/placed later on dynamically on the parent of that Transform.This fails then because the EditorOnly tag won't cull objects tagged as EditorOnly inside prefabs.
Is there any interest in taking a second look at this at some point? 'EditorOnly' is a bit misleading if it is only 'EditorOnly if the object is standing there on a scene'
Or maybe some best practices to do it as a build post process? when the prefabs get processed for a build?Thanks in advance
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Prefabs with "Flags" enum properties result in "IndexOutOfRangeException" when trying to commit/revert
- The Camera first person mode in Cameras overlay is greyed out and not clickable when the Editor is restarted with the Game View focused
- Scene View doesn't select the Canvas when it's clicked with the View Tool
- Transform fields are impossible to edit when Inspector window is resized
- Actions in UI Builder Preview mode are not fully reset after exiting the Preview mode
Resolution Note:
The EditorOnly tag is only supported on objects in Scenes, and has never been supported on assets being built into an asset bundle. We do not plan on adding support for this at this time.