So I’ve stumbled upon a weird issue. Everytime I start UE4, some cast object variables get unpinned which causes me errors. If I pin them and compile they work fine… But get reset when I restart the engine again…
Any idea why this happens? It started doing so today. I think it’s a bug.
UPDATE: I’ve found the root of the problem but I don’t know what’s causing it exactly. When I add a struct variable to my character(which where I’m casting the weapon reference variables from) this problem happens. When I remove it the problem disappears.
So I tried removing the struct and add a new one with similar properties but different names. It worked for a few days but now it doesn’t work again. The issue is not the variable inside the character because if I do a make struct it’ll also unpin.
I have this too. There are some blueprints that are fine when saved, but constantly require recompile when I reopen the project. It’s really frustrating.
Start editor, connect the nodes, quit editor, delete saved and intermediate folder, does this fixes the problem? Should work unless there are wrong references in things like custom functions, or outdated structure references.
This is likely a cyclic compile issue. I was wondering if you have a project that you could share with us the exhibits these issues so we could debug the problem?
How are you using your struct in the blueprint? Are the Primary/Secondary Weapon nodes coming from a Break Struct node? Can you provide a screenshot of your full blueprint setup?
The primary and secondary weapon variables are part of the character, a weapon on the ground is referencing them to check if the player is holding a similar weapon already. The actual weapons are attached to the player as child actors. The primary and secondary weapon variables are there for ease of use. I have tried referencing the child actor of the character directly inside the weapon to be picked up but that too gave me an error every time I start the engine.
The struct has the weapon classes in it. I use those weapon classes to set the child actors of the character.
Note that even if I unpin the construction script or not use the struct at all(just have it in my list of variables), the nodes still unpin on startup.
Now, I do not know if this permanently fixes the issue as for all I know it might return after a few days, but I will report here if that happens. Thanks for the support everyone!
EDIT: It seems to be only happening when you use a childBP as default value