Why is my child blueprint class not a valid subclass of its parent blueprint?

I have an actor blueprint called: GRD_INTR_Space

I have a child blueprint of “GRD_INTR_Space” called: GRD_INTR_InnerWall

I tried to create a local variable of class GRD_INTR_Space.

I tried to set the value to that variable to: class GRD_INTR_InnerWall

It threw this error:

“BlueprintEditorCompileResults:Error: Error Default value ‘/Game/GameData/Actors/Structures/GRD_INTR_InnerWall.GRD_INTR_InnerWall_C’ for Temp Item Class is invalid: ‘/Game/GameData/Actors/Structures/GRD_INTR_InnerWall.GRD_INTR_InnerWall_C isn’t a valid subclass of GRD_INTR_Space_C (specified on pin TempItemClass)’”

Why is this happening?

Every other display in the editor is clearly showing GRD_INTR_InnerWall as being a child of GRD_INTR_Space.

Bump?

I put together this image to help illustrate the problem.

These two blueprints are running “spawn actor from class” nodes, into a GRD_INTR_Space local variable.
In both blueprints, the class being spawned is GRD_INTR_HullWall.
(which is a subclass of GRD_INTR_Space)

For some reason, the ShipGenerater blueprint compiles fine, but the GRD_INTR_Space blueprint throws an error.

I got Windows 7 so I could get version 4.7 then spent time rebuilding the GRD_INTR_Space blueprint into a new blueprint and finally got my project running again.
After adding a single new child class, and a new function the new GRD_INTR_Space is once again throwing this error.

Class hierarchy is extremely important and I can’t continue until this issue is resolved. I can’t afford to spend days rebuilding the parent class from scratch every time I make a change… Please please tell me there is a solution to this… :frowning:

original answer deleted, lack of sleep made brain not work

So? It is entirely valid within scripting and coding to have variables be of a type equal to the class they are within.

Im not sure what part of your post is a solution to my problem.

You are right, my bad. I can’t answer your question as to why but i *think this might help you find a workaround. The parent can’t have a spawn actor from their child class node in the grid (don’t know why). When you hit compile it remains a question mark. The children can spawn the parent and other child classes of that parent in their grids and can set a variable of the parent class with either the spawn parent or child. Maybe if you use another child class in the way you wanted to use the parent it would work???

The parent no longer spawns anything. Neither does its children.
All spawning currently takes place in a different blueprint.
The error still occurs.

I’ve tried tons of combinations of spawn actor from class and so far only 2 problems were a child spawning same child BP immediately (of course it crashed the editor) and the above parent spawning children issue. I was able to get a child BP to spawn its own child BP and set a variable of the main parent class with that “grandchild” BP without an issue so that may be a possible solution.

I think you misunderstood. I did not mean the parent or child can’t spawn things. They can spawn things just fine.

I meant that I deliberately moved all spawning actions into a different blueprint that is unrelated to the class hierarchy of the parent and child.

Despite this the error still occurs. Which suggests your previous idea of moving spawning into a different child blueprint to be ineffective.
(and ultimately that spawning is completely unrelated to my problem)

Well without seeing all the pieces I can’t really know exactly what may help. Sorry I’m the only person who has taken the time to try and help you. Good luck and hope you can figure it out.

Just wanted to say that I have the same issues.

Hey, I’m having the same issue. Have you found a solution? Using version 4.7.6 btw

Unfortunately my answer was to “not use blueprint classes as parents of a subclass”.

Currently I work in C++ and make native classes there that are the parent classes of all my blueprints.

I haven’t posted this as the answer because it is avoiding the problem not fixing/answering it.

EDIT:
Also I should note, that I have not tried to subclass a blueprint since my last response to this thread so I am unaware if there is a fix or new method to do it.

I have had this issue as well. The only difference is that mine appears only when building. I get an issue with a variable of type (Parent) being set to (ChildA - a subclass of Parent). The editor filters the classes I can set that variable to either Parent or a subclass of Parent. I can’t select any other type of class (because of course not, none of the others are a Parent class). I feed this class into a spawn actor node, and use this actor reference (still ChildA) later down the line. There are no errors in PIE or compiling the BP. in runtime, it is perfectly functional. When I build the game (packaging) it always throws an error saying that (ChildA) isn’t a valid subclass of (Parent). This would be sequential inheritance, so (Grandparent) → (Parent) → (ChildA), (ChildB), etc. This issue occurred in the latest 4.9 version, and has recurred after we completely overhauled the method used.

I’m currently facing this issue as well… I’m pretty sure this had to do with cyclical dependency issue. As with all of those issue , the symptom seems to be senseless load error that goes away on first compile.

It leads me to think that the issue is in the load order of the blueprint.

I’m seeing it as well, for many months. I’m just waiting for it getting fixed in 4.11 or 4.12 or 4.13. It’s very close to this bug I reported half a year ago:

Hello,

After reading over the thread it appears that you are correct. This issue appears to be UE-17866. Thank you for your information and time. I will be sure to bump up the community interest for this issue.

Make it a great day

hi,
im facing this with a project i am doing as well. i have a parent characterBP with 4 child characters that are the ones you actually use in the game. none of them spawn - 3 are placed in the level and the other is the player start set in gamemode. when i package, two of the children say they aren’t valid children of the parent and any casting to them will fail,.then the packaging fails. i’ve rebuilt one of the children twice (they each have unique meshes and some variable settings and some attack codes that suit them individually) and i still get the problem. in the content browser when i mouseover them they say they are children of the parent; when i edit them they say, in the upper ight corner, that they are children of the parent. its completely holding my project up. im in 4.12.5 - has it been fixed in 4.13?
thx
-s

i tried it on 4.13, i upgraded the project. it packaged and created an executable, but i still get the error in the cook and when i play the binary, i cant switch between the characters like i programmed (it works in the editor of course) and their AI is buggy as well, so i guess their casts are failing just like the error says they will.