x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

3 Triggers to make a door open

Hello,

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

alt text

Product Version: UE 4.21
Tags:
3.png (272.7 kB)
more ▼

asked Feb 20 '19 at 01:42 PM in Blueprint Scripting

avatar image

SkullH4T
1 1

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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.

alt text

capture.png (462.8 kB)
more ▼

answered Feb 20 '19 at 02:19 PM

avatar image

ThompsonN13
9.4k 33 8 23

avatar image SkullH4T Feb 21 '19 at 09:38 PM

I had to have someone show how to get the extra nodes out but my graph looks pretty much like yours and i appreciate the feedback.

(comments are locked)
10|2000 characters needed characters left

I like doing it this way:

  1. Create an Int variable = 0;

  2. On any trigger overlap: Do Once => Increment Int by 1 (Int++) => Check if Int == 3;

  3. If True, Open Door.

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).

more ▼

answered Feb 20 '19 at 03:41 PM

avatar image

Tuerer
1.7k 11 6 8

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question