Getting reference to procedural mesh component

I have been running into major issues with getting or comparing references to procedural meshes. What I have set up is a modular armor system. Each armor piece is a static mesh with a procedural mesh component child. When initiated an array is made of all procedural mesh components, then put through a loop to copy procedural mesh from static and hide the static mesh. Later if damage is taken, the hit component is checked against the procedural mesh component array and health is removed or a slice is made.

This system work beautifully well, until you reload the project. Upon reload all “Find” nodes have to be replaced and primitive component reference pins re attached in a very specific order to restore functionality. Attached are pics that show the issues. I have recently moved this project from 4.13 where warning where issued but the blueprint still functioned. Now in 4.14 I am getting compile errors in place of the warnings.

Hello Blastertoad,

What were the warnings you were getting in 4.13? Are you able to reproduce this in a fresh project with just this logic added to it? This seems like a complicated set up so I don’t think I would be able to accurately recreate it in a way that would make me see the same issue so some additional information would be helpful.

Attached is the error I am getting in 4.13.2. I am currently rebuilding my project fresh in 4.14.1 so will work on this aspect tonight and share the results

OK so I built a simplified version of my setup. Same issue, it connects, compiles and runs fine when built. But as soon as the project is re-opened it has compile errors. Deleting flagged nodes and replacing them compiles without issue and runs.

Would you be able to share that simplified setup that you created, preferably one that is still in the 4.13 version so that we can take a look at the differences between the two versions and either try to figure out what is going on or put a bug report in for this?

I will build a demo project later tonight and include a work around I may have found. Thanks for looking into this

Attached is the demo project simplified as much as I can while being true to original intent link text

Hello Blastertoad,

I noticed from replacing the Find Item node to fix the warning/error that the way you’re adding the node seems to be a little bit of a hacky way to doing things. The Find Item node is meant to search through an array of a certain type for an item of that same type. This is evident when trying to add a Find Item node from pulling off the array rather than the Return Value of your Get Attach Parent or the other instances. It will fail to link up as the type of the array does not match the type of the item to be found. Due to the array pin being a wildcard and determining the type of the Item to Find pin, this works if the node is created off the other values, until the editor reloads and tries to reload the node.

You can do this correctly by just adding one node to each one of these luckily. All you need to do is cast to the ProceduralMeshComponent and StaticMeshComponent in these cases.

Here’s an image of what I mean:

From the Hit Component, I’ve added a Cast To ProceduralMeshComponent node and right-clicked to convert it to a pure cast (so we don’t need to run an execution through it.) This lets the blueprint editor know that from this point on, it can assume that the result from HitComponent (which could technically be any component in the engine as far as it knows) is a ProceduralMeshComponent and it can treat it as such. This lets the Find Item node connect to it as it doesn’t need to account for the fact that it could possibly be another type of component.

If there is the possibility that these events could be triggered when hitting a different type of component, I would suggest not converting to a Pure Cast and making sure that all of your logic past that point is hooked up to the Success (the blank pin) and either leaving “Cast Failed” as blank or having some logic there to handle this scenario.

You would need to do this for all of these instances, replacing ProceduralMeshComponent with whatever type of component the Array consists of.