Announcement

Collapse
No announcement yet.

Cast to a Blueprint Actor

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

    Cast to a Blueprint Actor

    Hello i have a Blueprint Actor and in this a Function

    i want to call this function from my Character but not work, only with get all actors of class work but not with cast to what i make false?

    what i need add as object in cast to? i try self

    and i try a variable with reference to the Blueprint.

    #2
    Usually it's Get Owner for object, or Get Player Pawn when you cast to the player actor pawn character...
    [LEGENDS of EPICA][Twitter][FB][YT][Vimeo][Reallusion Technical Expert]

    Comment


      #3
      not work

      only get all actors of class work

      Comment


        #4
        Depends from where you are calling the function. If your function is inside the character blueprint, you need a reference of the character saved somewhere (e.g Game Instance), unless you are calling it directly from inside the character blueprint. If you can give us some more details about what you are trying to achieve and you have right now we'll be able to help you better.

        Comment


          #5
          ok i make a Blueprint Actor and want to call a function or a custum event in this BP.

          this blueprint is in the world placed.

          now i want to call the event or function via button from character or controller but this not work, buit work if i make with all actors of class. but i want cast to.
          Last edited by JUDGE DREDD VR; 07-09-2017, 11:37 AM.

          Comment


            #6
            Well you need a reference of it. You can make a reference in your game instance, and when this actor is created, it saves a reference of itself in the Game Instance, then from your character, access the game instance and get the variable.

            Comment


              #7
              how you mean that

              make a variable with reference to my blueprint in my instance?

              Edit: dont work

              I cast to my game instance in my character and fire to a custom event in my instance

              in my instance have a variable with reference to my blueprint

              the custom event fire to my blueprint function
              Last edited by JUDGE DREDD VR; 07-09-2017, 02:50 PM.

              Comment


                #8
                This page might help you:
                https://docs.unrealengine.com/latest...ts/Blueprints/

                Epic had a video on it but I can't find it sorry

                Comment


                  #9
                  Originally posted by SKYNET2K View Post
                  how you mean that

                  make a variable with reference to my blueprint in my instance?

                  Edit: dont work

                  I cast to my game instance in my character and fire to a custom event in my instance

                  in my instance have a variable with reference to my blueprint

                  the custom event fire to my blueprint function
                  If you post a screenshot people can better assist you. Otherwise we can just point you to tutorials and general documentation.
                  [LEGENDS of EPICA][Twitter][FB][YT][Vimeo][Reallusion Technical Expert]

                  Comment


                    #10
                    Originally posted by SKYNET2K View Post
                    Hello i have a Blueprint Actor and in this a Function

                    i want to call this function from my Character but not work, only with get all actors of class work but not with cast to what i make false?

                    what i need add as object in cast to? i try self

                    and i try a variable with reference to the Blueprint.
                    In your first person character create a variable. Change the Variable type to the NAME of your BP Class Actor in the scene (Variable Name drop down).

                    Create a Function inside of your BP Class Actor ... call it "testfunction" or whatever and compile

                    Inside your FPC again, Right click and type in the name of that function.

                    The target input of that new function is your Variable you created above.
                    The Character is Self.

                    Try that.

                    Jerry
                    Now available on the UE Marketplace: Inventory Examine Interface -- and -- Fifty Knobs and Dials -- and -- Thirty Buttons Pack -- and --Kitchen and Bath Handles for Arch Vis -- and -- Chat Bot A.I. Simulator

                    Comment


                      #11
                      Originally posted by CreativeVilla View Post
                      In your first person character create a variable. Change the Variable type to the NAME of your BP Class Actor in the scene (Variable Name drop down).

                      Create a Function inside of your BP Class Actor ... call it "testfunction" or whatever and compile

                      Inside your FPC again, Right click and type in the name of that function.

                      The target input of that new function is your Variable you created above.
                      The Character is Self.

                      Try that.

                      Jerry
                      That i tryed before i post this here not work only all actors of class work
                      Last edited by JUDGE DREDD VR; 07-11-2017, 04:32 PM.

                      Comment

                      Working...
                      X