Blueprint to reset actor in loop after changing materials pressing a button
Hello everyone, I’m working on an architectural visualization and I’m trying to create a blueprint that allows the player to make other actors disappear by pressing a button. As you can see from the images, pressing B the group of meshes “BasamentiNeri” disappear (I’ve created a material that, from a black marble texture, becomes “invisible”, and then I’ve disabled collisions), and pressing L the group of meshes “CopiaBasamentoNero” (consisting in the same meshes, duplicated, made invisible at the begin and placed in the same position of “BasamentiNeri”) appears (I’ve created another material that, from “invisible”, becomes a black marble one, and then I’ve enabled collisions). This works, but, when I try to loop the button press (using EventTick and Sequence) it fails to reload the sequence of events linked to the change of materials.
Is there a way to reload the actor and the material after pressing B and L the first time, as if nothing had happened? I hope so. Thanks to whoever will help me.
asked Nov 20 '17 at 04:27 PM in Blueprint Scripting
One potential problem here is that your Event Tick - which is going to fire say 60-90 times per second depending on your PC - is likely flooding requests into your Timeline. Once that Gate opens with a key press, your code is spamming the Play button such that it barely has a millisecond or two to get going before it's told to start all over again. In effect, it would act like its not working at all.
I don't fully get why you'd want to Tick this instead of having the key presses start the timelines directly (they have their own internal timers already) ... but just in case you do need to go this route, I would suggest adding a "DoOnce" node before the Play on the timeline, then connect the Finished node on the right side of the timeline back into the Reset on the DoOnce. That would prevent the Tick from spamming it once its already started playing.
[Don't forget to brush up on Play From Start and Set New Time pins - those might come in handy for ya too.]
answered Nov 20 '17 at 07:55 PM
Thank you very much for the answer. I’ve tried to modify my blueprint according to your suggestions (I’ve deleted the link with the Event Tick, too), but the problem remains: pressing B, the group disappear (based on the properties of the material assigned); then, pressing L, the other group appears (based on the properties of the other material assigned); then, trying to press B or L, the group modifies only its collision.
I think the problem is the transition between the 2° group of meshes (with its material) and the 1° one (with the other material), but how can I reset this?
answered Nov 21 '17 at 10:13 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here