Announcement

Collapse
No announcement yet.

Public Editable Variable cannot be placed in external scope ; Break Constraint Gibbing Dismemberment

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

    Public Editable Variable cannot be placed in external scope ; Break Constraint Gibbing Dismemberment

    This is just one of those things that you'd expect to work relatively straight-forward. I have done this previously without issues in earlier versions of Unreal Engine, however I am stumped here on how a public global variable is outside of scope.

    I'm trying to get dismemberment/gibbing working in Unreal. I have the FPS starter kit open, and inside the projectile blueprint I am splitting the hit result to obtain the 'hit bone name' and assigning it to a public editable 'name' variable. I want to access this inside the Actor Blueprint of a character with a skeletal mesh, so I can use a Break Constraint using the aforementioned variable -- however, it says the name variable is outside of scope when I try to cross blueprints. I cannot figure out or find answers as to why crossing variables is not working.

    Does anyone have any ideas what is restricting the variable?
    Attached Files

    #2
    Are you trying to drag&drop one variable over different blueprints? Of course this isn't working, how could your Ninja_Blueprint ever know which projectiles's BoneHit variable he should take? You need to have a reference to the respective projectile in the Ninja_Blueprint and then take its BoneHit variable.

    Inside your EventHit event, you want to cast Other to Ninja_Blueprint and for example then call an event inside your Ninja_Blueprint that tells the Ninja_Blueprint what bone got hit. You need to create that event inside your Ninja_Blueprint on your own.

    Edit: Btw, the editable attribute of your variable doesn't have anything to do with this. I doubt you need the BoneHit variable to be editable.
    Last edited by Pepeeee; 12-01-2016, 03:30 PM.
    Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

    Comment


      #3
      That makes sense Pepe, and creating a cast was the first thing I tried before posting. I am however a bit confused as to this error stating that the "Ninja_Blueprint does not inherit from Primitive Component"


      Click image for larger version

Name:	primitive component.png
Views:	1
Size:	379.0 KB
ID:	1119194

      Comment


        #4
        Please plug "Other" in the cast, not "OtherComp".

        Now you only need to make the InBoneName of BreakConstraint an input variable of BoneWasHit. You can then plug the HitBoneName within your projectile blueprint directly in the BoneWasHit event call.
        Last edited by Pepeeee; 12-01-2016, 03:51 PM.
        Twitter | Multiplayer TopDown Survival Kit | Fog of War | Game Stats Kit

        Comment


          #5
          Pepe! Thank you so much for your help.

          As a side note, you must set your collision settings on the projectile to ignore the category of the collision capsule surrounding your character, and vice versa, the character's capsule must ignore the projectile's category. Thirdly, Character's Mesh must also have collision enabled, and it's category must not intersect with the projectile or capsule!

          Click image for larger version

Name:	collision.png
Views:	1
Size:	563.7 KB
ID:	1119219
          Attached Files

          Comment


            #6
            Demonstration

            https://media.giphy.com/media/26hirC...3u4o/giphy.gif
            Last edited by Retrotation; 12-01-2016, 09:37 PM.

            Comment

            Working...
            X