Linetrace. Count hit number on object

Hi,

i am working in a mobile oriented game. i want to use a linetrace for teleport to certain locations defined by “portal objects”. Everything working fine, but i want the teleportation to happen not inmediately on hit, but when you are hitting for a certain time. also when linetrace is not hitting the portal, the “timer” “counter” or whatever should reset. … this should be a very common thing … specially por teleportation on mobile devices. thanks, dani.

There are many ways to build a system like this. One way would be the following:

  1. Line trace to “portal” or whatever the object is you are trying to “hit”
  2. Use a sequence node after the line trace with 2 outputs, the first is a DoOnce node to store the hit object as a variable, the second then will drag off the line trace “hit actor” and connect to an “equal” boolean
  3. Check the variable “hit actor” continuously against the line trace “hit actor” through the second output pin of the sequence node (this will run a check as often as you are conducting a line trace to ensure the line trace is still hitting the same object as the first hit)
  4. Branch node will follow the second output pin of the sequence, the boolean requirement for it will be the output of the “equal actor” node set up previously
  5. Off the “true” execution pin run a delay for as long as you would like the player to wait before teleporting
  6. Off the “false” execution pin run a wire to the “reset” of the DoOnce node allowing execution to flow through that and reset the “hit actor” variable

ok, i understand, but, how i manage the time period for checking equality?

Was inspired this morning, solved it. i create some boolean variables, and get them in the event graph, then used delay :slight_smile:

glad you got it working. Can you mark this resolved to close the question out. thanks!