Skip to content

Prefabs not working correctly #8

Description

@SBird1337

When adding a decal to a prefab the Editor Tool does not recognize static meshes, if you deselect All static meshes and apply it to a mesh manually it will render correctly at first, but after re-opening the prefab or placing it in a scene the decal will disappear.

Steps to reproduce:

  1. Create an empty game object as a prefab
  2. Add a mesh object
  3. Add a Driven Decal Asset
  4. Project the mesh
  5. Close the prefab tab
  6. Re-open the prefab Tab
  7. The decal is gone.

Activity

  1. Anatta336 commented on Mar 7, 2021

    @Anatta336
    Owner

    Thank you for the report. I've been able to reproduce the issue, and will work on fixing it. It's definitely something that needs correcting!

  2. richgizmo commented on Mar 15, 2021

    @richgizmo

    Hi,
    I've got the same problem with prefabs not updating and decals disapearing.

  3. kriller509 commented on Jun 7, 2021

    @kriller509

    Can confirm it doesn't work with prefabs & that prefabs instantiated it also breaks with. This will probably prevent me from using it on our project unfortunately ;-;

  4. chisely commented on Sep 16, 2021

    @chisely

    This is probably because the generated decal mesh is not properly serialized and saved by Unity when prefab is closed.

    The workaround to similar issues seems to be to use some sort of simple serialization to store the mesh data in the prefab. Example: https://forum.unity.com/threads/solution-save-a-prefab-with-a-generated-mesh-es-without-creating-assets.463496/

    I'll test it and report back.


    Edit: Yep, using the script from the thread above the prefabs indeed do work correctly.

    The workflow is:

    1. Open prefab in prefab mode
    2. Create Decal gameobject and project it.
    3. Add the SerializeMesh script to decal gameobject (from link above)
    4. Click "Serialize" on SerializeMesh script.
    5. Save the prefab.

    Now, if the prefab is instantiated during runtime, the decals are properly displayed.

  5. alexzpopov commented on Oct 17, 2024

    @alexzpopov

    this work, but displayed with wrong rotation of mesh (so don't work correctly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions