Announcement

Collapse
No announcement yet.

Casting Custom Event Does Not Work

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

    Casting Custom Event Does Not Work

    I have 2 simple blueprints, one is just a wall that moves in a certain direction, the other is a trigger for the movement when the player enters it. (FYI Im using a blank project, not third person), The wall blueprint works fine on its own but the casting doesn't work.
    Click image for larger version

Name:	1.jpg
Views:	1
Size:	83.8 KB
ID:	1156225
    Click image for larger version

Name:	2.jpg
Views:	1
Size:	85.4 KB
ID:	1156226

    I've connected the Cast failed as well because the cast always fails for some reason. But even then the custom event does not fire in the wall blueprint. Thank you.

    #2
    If the cast fails then the 'Other Actor' is not of type plewp. It will never work. That actor is something else.
    Columbus Ohio Unreal Meetup
    @OCGameStudio | Sphere Complex | twitch.tv/WFMOz

    Comment


      #3
      If the cast fails you have other problems to solve.
      - Russell Meakim AKA The Castle
      BLOG: https://steemit.com/@thecastle

      Comment


        #4
        Originally posted by TheFoyer View Post
        If the cast fails then the 'Other Actor' is not of type plewp. It will never work. That actor is something else.
        The actor is supposed to be the player character, I presume, when it enters the trigger. I've tried the GetPlayerController but it still doesn't work.

        Comment


          #5
          Who owns the box trigger, the pawn or the moving wall? If it is the wall, you just need the target to be 'self'

          Comment


            #6
            Originally posted by _cDub View Post
            Who owns the box trigger, the pawn or the moving wall? If it is the wall, you just need the target to be 'self'
            It's a separate blueprint that contains only a box trigger.

            Comment


              #7
              What is "plewb"? Is this the wall? If you overlap with your Character, the cast will always fail, because you are trying to cast your Character to the Wall class, which is not possible.
              I recommend you to learn about classes and casting. Only because BP don't look like code, you will still need to understand how C++ works. Otherwise you won't get happy with BP.

              For your problem:

              Get a reference of the Wall that has the "Begin" event in your LevelBP by selecting it in the Level and rightclicking in the LevelBP. You should see something like "Add Reference of ..." there.
              Once you got that, remove the cast and the Event call. Cast the "Other Actor" to your CharacterBP Class (only to make sure that only the Character overlaps. You won't use the casted object!).
              Now, behind the successful cast, drag out a wire from the Wall Reference and call your "Begin". Pack this begin call behind the Successful cast.
              Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

              My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
              (Including 100+ Pages Multiplayer Network Compendium to get you started.)

              Comment

              Working...
              X