Announcement

Collapse
No announcement yet.

Why is my function returning a different object type?

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

    Why is my function returning a different object type?

    I have a function, with a single OUT variable of type Tile (which UE4 calls Tile_C).

    The function iterates through any hit results from a line trace, attempts to cast any hit actors to Tile, and if successful returns the reference.

    However the type of the returned object is SKEL_Tile_C. So I'm forced to re-cast it to the right type again in order to make use of it (attempts to link it up to anything expecting an object of type Tile fail).

    Can someone please explain why my function is not returning the specified type despite casting to that type right before the return node? Am I doing something wrong?



    Also, on a related note, I can no longer find the "Cast to ..." nodes. They seem to have completely disappeared from the list of available nodes, with or without "Context Sensitive" enabled
    Last edited by Boon; 04-11-2014, 05:12 AM.

    #2
    The _C means it is blueprint class.

    For the casting issue, I'm not sure though. What is the type of the return variable? It may be getting cast on return.

    Comment


      #3
      I think he mean why it becomes SKEL_ prefixed. I think James would have a better answer if he saw this.
      Unreal Engine 4 Game Framework diagram for relation of all major base object types
      Unreal Engine 4 Input Event diagram, scroll down to section Input Processing Procedural
      Resident Evil Classic Camera
      RPCs official document, Must Read
      Everything you should know about replication

      Comment


        #4
        Originally posted by PenguinTD View Post
        I think he mean why it becomes SKEL_ prefixed. I think James would have a better answer if he saw this.
        Yeah that's the question. The function has a type Tile_C return variable, the script casts to type Tile_C and yet the actual returned object is type SKEL_Tile_C and I have to re-cast it to avoid type mismatches.

        Comment


          #5
          That might be a bug. You should submit it on AnserHub

          Comment


            #6
            Okay I will do.

            Comment


              #7
              Anytime you see SKEL_ then that is a bug That is what we call a 'skeleton' class which is an internal construct you should never see. We'll look into this issue, if you have a repro please do post to Answer Hub, that would really help us track it down.
              Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
              Twitter: @EpicJamesG

              Comment


                #8
                Thanks for the reply, James! I assume 'repro' means instructions to reproduce? Is there some way I can send you a blueprint file? It's all contained in one blueprint class.

                Comment


                  #9
                  Sorry, yes, 'repro' = reproduction steps! You should be able to attach the problem blueprint to the Answer Hub question. Thanks for your help.
                  Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
                  Twitter: @EpicJamesG

                  Comment

                  Working...
                  X