UPROPERTY Components Hierarchy


Author: Matthew Pacheco

This week, I worked on getting the defenses set up with navigation and a bounds box. Doing this through C++ should have been relatively easy, as it is just a component getting attached and having values set. The defenses use a central empty or specific mesh as the root component, this allowed them to be properly placed in the world with all their components in the correct position. Since having something other than a scene or mesh component will end up spawning some things at the origin of the map. The first issue I encountered was that instead of the Bounds box being attached to the root like the rest of the components, it attached on a duplicated root component underneath the actual root. Being like this caused multiple issues with placement and adjusting the details in BP for some reason. I tried to figure out why this was happening by changing the structure of attachments and which was the root, but this lead to a larger issue. After commenting out some of the structure, and changing other pieces, I tried to compile it in the editor, but it failed. The error was for access to delete a make folder being denied. Similar errors showed when trying to build, rebuild, or clean the solution. I was unable to test anything without changing the UPROPERTYs to contain what was originally there.

After working with it for a while, I found that I had to generate the visual studio files again, clean, and then rebuild the solution. Doing this allowed the editor to compile, and I also noticed it caused the structure to change. Then, after a lot more testing and trying to figure out why this was happening, I was still unable to determine why this was happening. I did find, that this was also what was happening with the UTimelineComponent I had issues with prior. When new components, exposed to blueprint, are created, something must be stored to reference the structure. Altering it with C++ must not be able to really change it, so it is still looking for deleted UPROPERTYs, and it is adding new ones wherever it can in the structure. Re-generating the VS files corrects this if cleaned and rebuilt properly.

The workflow I have settled on using to minimize the issues the come up, and times I have to do it, is: Save all work that is being done on UPROPERTYs and attaching them > Close the Editor and VS > Generate VS files from File Explorer > Open the VS .sln > Clean and Rebuild the Solution > Open the Editor and Compile. This has the structure showing correctly, and all components acting like their UPROPERTY declares.

Posted on 10/19/2023

Get Cyber Siege

Leave a comment

Log in with itch.io to leave a comment.