Download

timeline with 2 float tracks fails to reverse

hey,

I’m making a window that you can open by pressing F, so I added some meshes I made as components onto an actor blueprint, and started scripting.
I added “on component begin and end overlap” events for my box trigger which toggles a tooltip text’s visibility and enable/disable player input, and then I added an “F key press” event, hooked into a flip flop which would play and reverse a timeline node, that controlled lerp rotators to set relative rotation to my window sashes.

when I had just one timeline float track, everything worked good, if I pressed F before the animation finished, it would pick from where it was and reverse, all fine, but then I tried to get fancy and add animation to the handles, so I added another float track to the same timeline to keep it simple and reverse in the correct order, but now when I press F, the animation plays only once, I have to get out of the box trigger and step in again, to be able to play the animation in reverse. this time everything works, it flip flops the animation fine, but the first time I step into the box trigger, I’m able to play it only once, which makes no sense to me

edit: ok so I was trying to diagnose it, and it appears that as soon as the first timeline float track finishes, the “on component end overlap” event triggers and disables my input (it also makes the tooltip text invisible) but I never left the trigger box. so I thought maybe one of the meshes was triggering the end overlap event, but i thought only pawns could do it,and also, the second time I enter the trigger box and try to interact, this whole thing doesn’t happen, it works fine.

what is wrong with this code?
(in my variables, “janela” means window, “maçaneta” means handle and “folha” means sash)

ok so I figured out that I was right, the window was triggering the on component end overlap. the problem was that I went even more fancy and added complex collisions as simple for the window sashes, which I didn’t have before, and apparently that makes it trigger overlap events.

so next question, how to make it not trigger these events?

Use Cast to make sure the actor that triggers the overlaps is the right one.

Is the trigger box part of the same actor? You are rotating with the timeline, maybe you rotate the trigger box as well?

the actor consists of the window frame, 2 window sashes and 2 handles, as well as the trigger box and the tooltip text. the trigger box should stay with the frame, since you want to be able to open / close the window when standing in front of it. also the sashes open to opposite sides

right, but how does that work? I would assume the overlap event should have an in pin to specify what actor should overlap it, but instead it has tons of out pins. I never understood quite well how the Cast to node works, could you tell some more about this?

The Cast node should be between the Overlap events and the Enable/Disable inputs.
So, connect “Other Actor” from the Overlap event to “Object” in Cast to [your character].

oh I see. so basically the cast to node will only run the out pin if the actor feeding it’s “object” in pin is the same it’s casting to, right?

so if another actor (say the window sash) triggers the overlap event, then the “other actor” out pin from the event node will output the window actor, and so the “cast to” will fail because it’s casting to the character, is that correct?

if that’s so, then I guess my trouble was understanding the “other actor” pin from the overlap event too, not just the cast to node. but I guess it makes sense now, if I understood it correctly

Yes, exactly.