How to detect if actor stopped moving inside a trigger box?

Hello everyone, I am fairly new to this so please bear with me. I have created a stop sign in my game and placed a trigger box next to it.

How can I make the trigger box detect that a car has stopped moving within the box using blueprints?

1 Like

How are you moving the car?

Using enhanced input via arrow keys.

Not what I meant. What is the method of moving the car? Which nodes follow?

Are we using physics to move it? Is the car a pawn with a movement component? Are you adding world offset? Detecting when things stop moving will depend on how they are being moved.

My apologies. The car is a pawn with a movement component, also I am using Chaos Vehicles if this helps

In that case you can simply query the veloctiy. Start doing it every frame (or every x seconds) as soon as the car enteres the box, stop doing it once it leaves. Compare the lenght of the velocity vector to a near-zero value.

Do you mind telling me which nodes I can use to achieve this? Sorry I am a bit lost with this one

Build a stopping area like so:

  • larger outer collision volume
  • smaller inner collision volume
  • the car mesh is here just to visualise what is needed

If we stop like this, it’s a failed parking attempt:

The car is not overlapping the inner box :point_up_2:
This is much better, the car overlaps both boxes :point_down:

Adjust the size of both volumes to dictate how accurate the player must be in order to stop correctly.

  • alternatively, instead of the inner box, build boundaries around the area the car must not touch.
  • and yet another way is to detect null velocity first in the large box and then run 4 traces around its perimeter. If nothing gets hit, the car was fully inside.

The script is in one actor, ideally in the base vehicle class:


Things can be done better, but we’d need to know the scope.

Oh, this makes sense now! thank you so much for the help, truly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.