FlaxEngine icon indicating copy to clipboard operation
FlaxEngine copied to clipboard

[ BUG ] Prefabs on scene lose changes (caused by arrays)

Open MrCapy0 opened this issue 7 months ago • 2 comments

Sometimes i lose some prefab changes when i have scripts with arrays.

https://github.com/user-attachments/assets/76730095-6321-4809-b3e4-7d02d026172e

My code:

using FlaxEngine;

namespace Game;

public class TestArray : Script
{
    public struct Struct
    {
        public Actor A;
        public int B;
    }

    public Struct[] MyArray2;
}

Version: Master

MrCapy0 avatar May 24 '25 13:05 MrCapy0

Make sure you use the Serializable attribute on your struct.

Tryibion avatar May 24 '25 14:05 Tryibion

@Tryibion i tried this but does not work too:

    [System.Serializable]
    public struct Struct
    {
        [Serialize] public Actor A;
        [Serialize] public int B;
    }

MrCapy0 avatar May 24 '25 20:05 MrCapy0