Announcement

Collapse
No announcement yet.

End Overlap Not Triggering. What are My Alternatives?

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

    End Overlap Not Triggering. What are My Alternatives?

    So my project involves a puzzle with four pushable mirrors, which you use to reflect light to a specific location to solve. The "Light" in question is a static mesh, and when the mirror passes through it an On Component Begin Overlap event is triggered and the mirror adds an identical static mesh to itself at a perpendicular angle. When the "Reflection" hits another mirror, the second mirror creates another reflection, and so on and so forth.

    The problem starts when I push a mirror out of the light. For some reason, the mirrors won't stop reflecting. Usually the first one will stop just fine, but the ones after it continue as if their states haven't changed.

    Initially, I was using a On Component End Overlap event to trigger a Destroy Component command to remove the reflection when the mirror leaves the light or a reflection. From what I can tell, End Overlap never triggers on the second mirror, yet always works fine for the first.

    The next thing I tried was using a Line Trace to detect the previous mirror, and when it can't detect the mirror the reflection is destroyed. This only kind of works. The second mirror doesn't seem to recognize the first has moved until it is pushed away or another object (like the player character) passes through the Line Trace.

    I also tried creating a Function that passes an additional boolean variable that would be required to continue reflecting, but I couldn't figure out how to get it to work.

    Lastly, I created a couple Box volumes on either side of the mirrors that use Begin Overlap to do what I was trying to do with End Overlap. This doesn't work, either, though I imagine this is because the reflection is being destroyed before it can properly trigger Begin Overlap. I can't really tell.

    I've been working on this for weeks, and that's all I could come up with. Is there something I need to be doing to make sure these are working properly, or is there something that could do the job better?

    #2
    Hello,
    Maybe your reference is not updated on next begin overlap and then it is possible to destroy only the first one. Do you set your reference with overlapped item each time (self or other actor output node depending of your setting) ?

    Comment


      #3
      Originally posted by Fen View Post
      Hello,
      Maybe your reference is not updated on next begin overlap and then it is possible to destroy only the first one. Do you set your reference with overlapped item each time (self or other actor output node depending of your setting) ?
      Well, I was having a problem where the first mirror didn't stop. I discovered that Begin Overlap was being executed multiple times, thus creating more reflections than it can destroy, but I fixed that with a Boolean variable and a Branch. The first time Begin Overlap is triggered, the Boolean is set to "True" and the Branch only allows the initial reflection to be created when it is set to "False." Event Tick takes over after that, destroying and recreating the reflection only when the Boolean is set to True. I also set up a Print String on Event Tick to report the state of the Boolean, and it shows that when the second mirror leaves the first mirror's reflection by moving the first mirror out of the light source, the first mirror's Boolean gets set to True but the second mirror's Boolean remains at False.

      I do have both Begin Overlap and End Overlap set up with Branches that check to see if the other Actor has a Tag I set up, but I was already having the problem with End Overlap when I set up those Branches. I'm not sure if I tried that with Line Trace or Begin Overlap, though.

      Comment


        #4
        Ok, if you can post a screenshot, i'll can do a try to find a solution and other members too.

        Comment


          #5
          Originally posted by Fen View Post
          Ok, if you can post a screenshot, i'll can do a try to find a solution and other members too.
          I put the test project in my DropBox if you'd rather have the whole test project: https://www.dropbox.com/sh/ffid78uaw...5-b4Tpfka?dl=0
          It's simply convenient for me at the moment because I was giving this link to someone on the Answer Hub. It's more or less just the 3rd Person sample project with the "mirrors" in it. They currently only "reflect" in one direction, so it's not going to be perpendicular or anything. I wanted it to be able to stop before I moved on to making it turn. Only one of the stopping methods is currently connected, and I haven't rested all the ones I disconnected yet.

          I'll go ahead and get the screenshot if you'd rather, though. I can't fit the entire blueprint on-screen at once so it'll either be in pieces or I'll have to Photoshop them together.

          Comment


            #6
            Well, I didn't know you could save screenshots directly to DropBox. Here, check them out: https://www.dropbox.com/sh/vcg15ft84...HAgBGg1Ka?dl=0
            Last edited by Avernale; 12-07-2014, 09:29 PM. Reason: Changed "shave" to "share," then "share" to "save."

            Comment


              #7
              Oh yes,
              i am not totally sure as i couldn't use your blueprint (it is a text and when downloaded not recognized by my unreal project, maybe doing a zip if this don't solve)
              but i suppose that the trouble is that you don't end overlap other mirrors. Light is just deleted not end hovered so blueprint can't execute end overlap. What i would try is to set an int registering the order of mirrors and on end overlap do a loop (from actual mirror to max mirror) for the mirror moved and all others after this one with a custom event / function with overlap effect.

              Comment


                #8
                How do I do that? I tried making a function, but I don't know how these things work.

                Comment


                  #9
                  Create a variable int "Index" and set it in right order from 0 to max with actor references on "event begin play" in level blueprint. And In mirrorSphere :
                  Click image for larger version

Name:	mirror.jpg
Views:	1
Size:	44.6 KB
ID:	1061899

                  Replace Bp_Chair by mirrorSphere. (In hope my supposition was right ^^)

                  Comment


                    #10
                    I understand everything in that post except "Set it in right order from 0 to max with actor references." Right now in my Level Blueprint, Event Play executes Get All Actors of Class (with Actor Class set to "mirrorSphere"), which executes a For Each Loop that takes the Array input and outputs Array Element into a Set node for Index. Meanwhile, mirrorSphere itself has the the same set up as the picture you posted (with "mirrorSphere" in place of "Bp_Chair," of course). I assume I did something wrong, because it's not working.

                    Also, what is this supposed to do? From what I can tell, the Level blueprint counts the number of mirrors and stores it in Index, then each mirror checks the value of Index against the value of Index, which will either be the default value or the number of mirrors, OnComponentEndOverlap, which wasn't working to begin with.

                    Edit: Just figured out how to update the length of the reflection using a Set Relative Transform node without having to destroy it. It still doesn't work. Well, rather, when I move the second mirror, the first mirror (which is still in a light source) stops reflecting instead of the second. Haven't explored why that's happening yet.
                    Last edited by Avernale; 12-16-2014, 08:55 PM.

                    Comment


                      #11
                      You have to set the value of index in each mirror sphere set in your map. The first one 0, the second 1 the third 2 and then to the end, in the order of the light movement. Then when you'll loop, you'll deactivate all the mirros which are after the one you deactivate.

                      Comment

                      Working...
                      X