Issue: When I make an instance of a BP class, the component hierarchy is not the same as it is in the BP class. This only began occurring after the update to 4.11. Crane instances made previous to that are correct.
The component hierarchy in the BP class: (note the hoistMesh is parented to the hoistSpline)
The component hierarchy in the instance: (note the hoistMesh is no longer parented to the hoist Spline)
Repro steps:
Drag and drop CraneBP from the Content Browser to the level viewport.
Check the component hierarchy in the details panel and compare it to that in the blueprint class.
Update: I have attached the .cpp/.h for the crane, which this BP inherets from, as well as the crane uasset file. [Here.][3]
Update: Using the code method Sean recommended. Note that the hoistMesh is supposed to be parented to the hoistSpline.
Hello, thank you for the response. This is a blueprint derived from a C++ class, and I have only noticed it with this blueprint so far. I am trying it with a clean project right now and I will let you know.
Did you make it using the C++ files that I attached to the question? I did recreate the blueprint in a new project, using those code files, and had the same problem.
I am attempting to reproduce this issue with a clean asset in order to determine if the issue is asset-specific, or if it relates to something that has somehow become corrupted in your original asset.
If you could recreate the code classes and blueprint, not necessarily in a new project as long as the asset itself is from scratch, that would help determine if this is an issue with corruption or if it is something that you have set up in your code.
The code files I have attached are bare-bones versions of the ones in my project (all the functionality is cut out, it is just the component initialization). I made a new project and completely recreated the asset with those bare-bones C++ files, and still had the problem. Is that what you mean by “from scratch”?
I also made a new, similar actor, without being derived from C++, and it seems to work okay. So I wonder if something in my code is the problem? But why would it have worked in 4.10 and in the blueprint itself, but not the instances?
It’s definitely possible that it is an issue with the code, since neither of us have been able to reproduce it in a clean project, or with a new asset. I’ll continue to take a look at the code and see if I can find anything that could be causing this issue. In the meantime please respond back if you find any additional information during your testing.
Well I was able to reproduce it in a clean project, but I haven’t seen it happen with any other assets based off of C++ files. I think it might be spline-related.
When you say that it is spline-related, do you mean that it happens to any blueprint that contains a spline component? Have you been able to verify that this is the case?
When you reproduced it in a clean project, was it with the same asset or did you create a new asset?
Thank you for providing the additional information. However, I have not been able to reproduce the issue in a clean project on my end. Could you please zip up and provide your entire project? You can upload it to Dropbox and send me a link through PM on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint
Have you tried it inherited from C++ classes? It doesn’t happen otherwise. If you confirm that you have tried that, then I will zip my project and see about getting it on drop box :). Thanks for your help!
Yeah I have tried it when inheriting from a code class but I wasn’t getting the same behavior so it looks like I’m overlooking a small step. Looking at the project will allow me to determine what this could be. Thanks!
I have the BoxComponent set as the root component, and then the Spline Mesh is attached to the Box Component. I noticed that you were using PCIP, which is outdated API and no longer necessary, as well as using AttachParent instead of the AttachTo function. Try using AttachTo instead because that seems to work for me. Using the initialization code above, I did not see any inconsistencies in my hierarchy in the blueprint instance that I added to my level.