3 Triggers to make a door open
I am very new to Unreal and for a school project i am trying to make a large door open with 3 switches and this is what i tried to rig up before but its not working. i got the switches to work but not the main doors. and i am unfamiliar with the whole blueprinting process so any feed back would be appreciated
what your doing currently would never work since you are setting your variables to false then checking if all are true to open the door. so to solve your issue you really just need to set the variables to true. though theres a few other things i would change to make your script run better which i will show below.
first off tick can be expensive and i would avoid using it when possible and when theres a easy alternative. in this case you could just call a event which checks if the door should open whenever a switch is activated. as you can see in the picture below when the timeline to move the switch is finished we call the event "check open door" which checks to see if all variables are set to true and if they are it opens the door. if you used tick here the checking of the variables would be happening 30-120 times per second depending on your fps, if you use this alternative method then the check will happen once each time you activate a switch which will save you performance. the second thing to change is where you set your variable. in your current setup your setting the variable on timeline update which again is basically like tick in how often its called. by simply moving the set variable to the finished node it again gets called once saving performance. now i should clarify here that with this simple of a script and how few actors there are performance is probably not a issue and doing this on tick would probably be fine, but i find it good practice to do things the performant way and make that a habit instead of making the alternative the habit.
answered Feb 20 '19 at 02:19 PM
I like doing it this way:
So basically you only have one function, but 3 sets of Overlap and DoOnce nodes (plus any anymation you need for your swithes, but you can as well use one timeline for three of them if you save your Switch to a variable and use the Timeline with that variable instead of a direct switch reference).
Follow this question
Once you sign in you will be able to subscribe for any updates here