Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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)'"

    Every other display in the editor is clearly showing GRD_INTR_InnerWall as being a child of GRD_INTR_Space.
    InnerWall has all of its parent components. All of the parent variables are being correctly inherited. I can call all the functions of the parent correctly.

    I found this on AnswerHub and suspect it as the cause.
    Is there a work around or fixes known?
    I can't continue my project in its current state, and I am hesitant to try restarting it if this is just going to happen again...


    (Ive not had alot of success getting my questions answered on AnswerHub recently, so Im posting here as well to "hedge my bets")
    Last edited by Erdrik; 02-12-2015, 08:33 PM.

    #2
    Sorry for the double post, I put together this image to help illustrate the problem.

    Click image for larger version

Name:	UE4CompileBug.jpg
Views:	1
Size:	95.8 KB
ID:	1066401

    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.

    Comment


      #3
      Try to cast the return value to your class or change the variable type to `actor`.

      PS. Hold the mouse over the SpawnActor's `return value` and check what type does it return.
      Last edited by AdAstra; 02-16-2015, 04:18 AM.

      Comment


        #4
        SpawnActors return value is correct.
        Return value is GRD_INTR_HullWall in the image example.

        Casting won't work here, as Im trying to spawn a childclass and then set it to a variable that is its parent class.
        (You can see in the image the spawn actor class is GRD_INTR_HullWall, and Ive edited in the variable's class(GRD_INTR_Space) below it)


        Changing the Variable type to actor will allow it to be set to the spawned actor, but I won't be able to manipulate the variables and functions I need from the parent class.
        (I would have to cast it to GRD_INTR_Space, which just brings about the same problem all over again.)

        Comment


          #5
          In 4.7 I spent time rebuilding the GRD_INTR_Space blueprint from scratch and even renamed it to ensure the bug did not carry over.
          It worked, and I was able to continue work on the project ... for a bit.
          I added a single new child class and a new function in the newly remade parent class, and now the error has returned.

          Class hierarchy is extremely important and I can't continue until this issue is resolved.
          If anyone has any information on this issue(if it is a known and worked on, or fixes, ect) please let me know.

          Comment

          Working...
          X