Announcement

Collapse
No announcement yet.

Event Begin Play + Get All Actors Of Class + GET + Cast to My Character.

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

    Event Begin Play + Get All Actors Of Class + GET + Cast to My Character.

    I was watching this: https://www.youtube.com/watch?v=Oi0BHiBxPQI

    At 6:48 he starts a reference from "My Character" in another blueprint and puts in:

    Event Begin Play + Get All Actors Of Class (Chooses "My Character") + GET + Cast to My Character.

    Joins them up.

    If I do, I can not get the reference "Set ##### Alive", but can if I replicate this in "My Character" BP.

    Any Ideas?
    http://www.seven-mountains.eu/


    #2
    in 4.6 you need to set variables to public, do this by clicking & opening the eye to the right of the variable making it a public variable. (something new for casting in 4.6, they probably did this because casting was accessing private (or local) variables)

    also @7:12 make sure you pull off the blue pin of cast to mycharacter & promote to variable so it's an object of the MyCharacter class as well.
    (he also moves down in the event graph to set the Boolean variable 'BisDiscAlive', so make sure you are pulling/putting it in the right spot)

    mainly check to see variable is set to public first, just from a quick look that might be the problem. (4.6 thing)

    I haven't done this tutorial but I hope this helps, n good luck
    Last edited by ayretek; 12-16-2014, 02:18 AM.

    Comment


      #3
      Thank you . Will go through that when I get home from work.

      Cheers
      Narg.
      http://www.seven-mountains.eu/

      Comment


        #4
        Seem to be able to get "Get" but not set. May need to look into it further
        http://www.seven-mountains.eu/

        Comment


          #5
          Weird, can't really think of any case that should happen, but..

          just in case look back and step thru starting around 6:50:
          ***make sure you used GetAllActorsOfClass (not just some actors, lol) & check the drop down list & make sure you have it set to the 'MyCharacter' Class('Or' whatever you named your character or class that has the variable in it)
          this is an easy mistake to make if you click out of it too fast etc. it doesn't get set and the rest fails.
          ***and make sure you use whatever your character class is in the cast to the name of your character, if it's actually MyCharacter BP then use that, the reason I said to check it is because I used another name & still had the MyCharacter BP in a project I was messing around in the other day & actually made this mistake and casted to the original MyCharacter BP instead of mine.
          *** make sure you drag out from the blue pin of the cast to mycharacter node and promote to variable (or I think you can just right click on it & promote to variable too) this sets this variable to the MyCharacter object type
          *** when you right click n get the character reference (the promote to variable from the cast you just made) pull off of it and just type DiscAlive (this way if there is any misspelling->whatever variable you did create should show up)

          I know this sounds redundant and a pain but best way to step back thru it, often it's just a mistype or some little thing that messes stuff up. It's really easy to do especially when trying to follow someone else's work. Also take your time when you are stepping back thru your code, it's so frustrating when something doesn't work right that we get in a rush & I have even overlooked some simple mistake 2 or 3 times.

          It's always the little things that get ya!
          Last edited by ayretek; 12-16-2014, 09:20 AM.

          Comment


            #6
            Seems I have applied all theory correctly.

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	42.6 KB
ID:	1064200

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	13.1 KB
ID:	1064201

            This is what I get

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	19.6 KB
ID:	1064206

            But I do get this every time I change a node before I compile and did not see this in Tutorial. Example, I made a random Variable.

            Before

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	45.4 KB
ID:	1064205

            After

            Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	51.9 KB
ID:	1064204

            Delete a fake Variable
            Attached Files
            http://www.seven-mountains.eu/

            Comment


              #7
              Forgot this one

              Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	73.9 KB
ID:	1064207
              http://www.seven-mountains.eu/

              Comment


                #8
                are you talking about those errors popping up when you add that variable but they disappear after you compile & save your BP?
                (other than that it does looks setup right -> note: after you pull off that character & set the character object reference if you click on same variable on the left you should see it set to that class you created it from, in this case probably should be MyCharacter type variable)

                but if those go away after compile just continue with the tutorial. if you can now set that variable from the (get) character reference around 7:20 in that video ya should be fine

                let me show you something:
                is this what you are worried about - TADA
                Click image for larger version

Name:	ErrorChristmasTree.jpg
Views:	2
Size:	239.5 KB
ID:	1064208

                it happens while it's trying to figure out what i'm trying to do, lol. already existing/ working project added variable & this happens until I compile & save.
                Lights up like a Christmas Tree!
                And Just in Time For Christmas too! lol
                Last edited by ayretek; 12-17-2014, 07:34 AM.

                Comment


                  #9
                  Originally posted by ayretek View Post
                  are you talking about those errors popping up when you add that variable but they disappear after you compile & save your BP?
                  (other than that it does looks setup right -> note: after you pull off that character & set the character object reference if you click on same variable on the left you should see it set to that class you created it from, in this case probably should be MyCharacter type variable)

                  but if those go away after compile just continue with the tutorial. if you can now set that variable from the (get) character reference around 7:20 in that video ya should be fine

                  let me show you something:
                  is this what you are worried about - TADA

                  it happens while it's trying to figure out what i'm trying to do, lol. already existing/ working project added variable & this happens until I compile & save.
                  Lights up like a Christmas Tree!
                  And Just in Time For Christmas too! lol
                  Ok, that help, I thought it was nothing, just was not sure if it was a noob mistake.
                  http://www.seven-mountains.eu/

                  Comment


                    #10
                    hopefully you should be fine now

                    yeah those errors Christmas Tree'n like that will scare ya to death, I felt better after I saw it happening to the UE4 devs doing tutorials tho'. lol

                    ps: always be careful when you change names or something while doing tutorials I do it all the time but it's the first place that mistakes can happen

                    Comment


                      #11
                      Still unsure why I can get "Get" but not set. Redoing the entire TUT again
                      http://www.seven-mountains.eu/

                      Comment

                      Working...
                      X