Announcement

Collapse
No announcement yet.

Issues with lighting candles and torches. Seems like it should be easy.

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

    Issues with lighting candles and torches. Seems like it should be easy.

    So I've set up a little scene where I can pick up an unlit torch bring it to a lit candle and light the torch off it, then use the lit torch to light other unlit candles, it worked great. I had two separate blueprints, one for torch and one for candle. Just made children of each of those and filled my scene. All the logic is in the parents. I had a Collision sphere on each blueprint and would just use an OnComponentBeginOverlap to check if the other collision sphere was the colliding component.

    Now the problem occurs when i tried to set up a lit torch being able to light another torch, or a candle being use to light another candle. I just cant figure out how to get the OnComponentBeginOverlap to determine if its another collision sphere of the same overlapping itself or what. Even if i can get it to return true it still wont light the candle.

    It just seems like it should be something very simple im overlooking or overthinking, idk. But I know this should be something thats possible to do. Once I get this figured out I can just simplify to one candle parent blueprint and use the children for torches and different types of candles that will all share the same functionality of being able to light each other on fire.

    #2
    Heres a video I had made for someone that may be of some use as to how I have it set up and the issue I'm having, Thanks! -Mayor

    https://youtu.be/wLCLdYrU-Xo

    Comment


      #3
      I would try to generalize this, by using an interface for all actors that can be lit or can light others. You can just make an interface function and do the "is lit" checks from there.
      Michael Hegemann - https://twitter.com/HegiDev

      Marketplace Content
      Easy Multi Save
      Mobile Touch Navigation
      Retro 3D Toolkit

      Comment


        #4
        Originally posted by HEGI View Post
        I would try to generalize this, by using an interface for all actors that can be lit or can light others. You can just make an interface function and do the "is lit" checks from there.
        Hey, Thank you for the advice! I feel like I understand what you mean, but I dont see how that helps my main underlying issue. Which is I cannot get the torch to light another torch, I can make the torch light any item in the game, except another torch... I understand this whole blueprint could be much simpler/cleaner, and I plan to do that. Once I figure out how to light a torch with another torch (instance of the same actor blueprint) though.

        Now if what you suggested would fix that then I apologize, I must not fully understand it. I just assume that an interface would help communicate between different blueprints, what I'm trying to do involves just one blueprint. Thank you though! I really do appreciate the input.

        If anyone needs me to clarify anything please let me know. I cant believe this issue hasnt been solved yet. I feel like Im overlooking something very simple, but maybe not.

        Comment


          #5
          Alright, after working on some other projects and coming back to this, I've managed to figure it out.

          What I needed to do was on the ComponentBeginOverlap, GetAllActorsOfClass for my torch BP and then check to see if the overlapping actor was one from the GetAllActorsOfClass AND if the overlapped component was overlapping. The key here was to save that array element in a Variable of the bp torch ref, then I could pull all of the normal BP Torch variables from that specific variable reference so when asking the question of isTorchLit, I can now ask specifically about the "Other" torch and not just the one im holding. Sorry if thats confusing -_-

          Pics to clear it up
          Click image for larger version

Name:	Screenshot 2017-03-07 02.53.41.png
Views:	1
Size:	350.7 KB
ID:	1124436
          Click image for larger version

Name:	Screenshot 2017-03-07 02.53.49.png
Views:	1
Size:	301.8 KB
ID:	1124437

          https://www.youtube.com/watch?v=RnAztFhKi9Q
          Video in detail
          Last edited by Mayor Adam West; 03-07-2017, 04:44 AM.

          Comment


            #6
            Hi !

            I've manage to go further in your tutorial but I'm stuck here :
            Click image for larger version

Name:	Untitled.png
Views:	1
Size:	384.0 KB
ID:	1126999

            Do you know why it could do such error ?

            Thanks for your help !!
            Cedric

            edit : seems the foreachloop was bugged, deleting it and recreating it solved the issue.
            Attached Files
            Last edited by Sedoriku; 05-01-2017, 02:21 PM.

            Comment

            Working...
            X