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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Overlap Timer

Hi everyone, i'm trying to make a really simple game, my trouble is that my player has to choose beteween 2 paths, kinda Y interesection, but I need to let him overlap the choosen path for X seconds to the action to happend (follow spline) can someone show me how to set a timer? I've event already StartOverlap that change the color of the object and then get the path and EndOverlap that returns the old color, my timer has to be after change color, wait X seconds, check if it's still overlapping and then get the path. I hope u can understand me!alt text alt text

Product Version: UE 4.19
Tags:
mypath.png (388.7 kB)
mypath.png (275.3 kB)
more ▼

asked Feb 08 '19 at 01:47 AM in Blueprint Scripting

avatar image

Juanix123
3 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

below is three examples of how this could be done. for your purposes i would try using method 2 since its simple and will work well with your current setup.

method 1 relies on a gate opening and closing depending on if the player is overlapping. basically we open the gate and start a countdown on begin overlap, then if the gate is still open after the delay your script is run.

method 2 relies on timers. the idea here is you start a timer on begin overlap, then if the timer is still valid by the time its meant to run then it runs if not nothing happens.

method 3 is sort of a brute force approach. on begin overlap we start a delay then when the delay is done we check to see if the player is still overlapping by checking it against every overlapping actor.

alt text

capture.png (485.1 kB)
more ▼

answered Feb 08 '19 at 02:59 AM

avatar image

ThompsonN13
10.1k 33 10 23

avatar image ThompsonN13 Feb 08 '19 at 03:00 AM

oh and do note i put flow control in a few of these examples but its not strictly necessary. the other actor == branch bits are flow control.

avatar image Juanix123 Feb 08 '19 at 03:31 AM

Glorious ThompsoN13! I know it should be a silly thing but i've been troubling with this half day hehehhe, thnks u very much for several options, the second one works just fine, but i'll try the gate node for learning!

avatar image Nebula Games Inc Feb 08 '19 at 06:10 AM

Haha, sorry took too long... I was actually just making the screen shots for this but ThompsonN13 beat me to it I see. I go to post and I see the question answered already. Funny enough, my method was exactly method 1, I just used a regular delay though (only difference, still works the same) anyway glad it is working.

avatar image ThompsonN13 Feb 08 '19 at 02:44 PM

haha yea that happens to me all the time too. as for the delay the retriggerable is actually useful in this case, it ensures that the player is overlapping continually and not just moving in and out. if they begin overlap again the timer restarts.

avatar image Nebula Games Inc Feb 08 '19 at 03:12 PM

Ah yea, makes sense, I just whipped something up quick did a few play tests and it seemed fine, I figured since end overlap closed the gate it wouldn't matter but I didn't get to the caveat where you leave and come back before the delay finished, that would have been a bug in my system. Well thanks for getting to this for me (this was a question from my YouTube tutorial) I felt like I need to solve the issue.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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