# How to let vehicle avoid vehicle when they move to same location?

**URL:** <https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191>\
**Category:** World Creation\
**Tags:** vehicle, unreal-engine, Physics, UE4, avoidance, Blueprint, question\
**Created:** [August 21, 2019, 2:04pm UTC](https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191 "2019-08-21T14:04:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![XiaLi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XiaLi](https://forums.unrealengine.com/u/XiaLi)\
**Post date:** [August 21, 2019, 2:04pm UTC](https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191/1 "2019-08-21T14:04:56Z")

</div>

Hi, everyone.

I’m working on a simple rts project. And I have made a vehicle blueprint. Now I want let some vehicle move to a location with formation. But on the way to location, sometimes vehicles colliding with each other. How can I make vehicles “konw” others and avoid ?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Big\_R-07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Big\_R-07](https://forums.unrealengine.com/u/Big_R-07)\
**Post date:** [August 21, 2019, 2:41pm UTC](https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191/2 "2019-08-21T14:41:31Z")

</div>

When running the code for moving them into formation simply set actor enable collision to false then when its done turn it back on if you still want there to be collision with other objects in your scene. If you want it to hit everything else even when it is moving into formation except the other cars then just set the collision preset to be custom, make the object type vehicle, and make sure the object response it is set to block. Then when you execute the code for the formation, change the collision object response to the vehicle to ignore then when it’s done set it back to block. Conversely if you ever want anything to happen when they overlap another car just set it to overlap in the collision object response.

---

<div class="post-metadata">

**Author:** ![XiaLi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XiaLi](https://forums.unrealengine.com/u/XiaLi)\
**Post date:** [August 22, 2019, 6:15am UTC](https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191/3 "2019-08-22T06:15:47Z")

</div>

Thank you, Big\_R\_07. But what I want is make vehicle more “smarter”. I did’n want vehicles overlap with eath others when they are moving.

---

<div class="post-metadata">

**Author:** ![Big\_R-07](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Big\_R-07](https://forums.unrealengine.com/u/Big_R-07)\
**Post date:** [August 22, 2019, 12:10pm UTC](https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191/4 "2019-08-22T12:10:11Z")

</div>

Then it sounds like what your wanting is a car AI. In which case you can look into making AI and also using a nav mesh bounds volume. This would also delve into behavior trees and blackboards depending on how complicated you want them to be.

---

<div class="post-metadata">

**Author:** ![XiaLi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@XiaLi](https://forums.unrealengine.com/u/XiaLi)\
**Post date:** [August 23, 2019, 7:19am UTC](https://forums.unrealengine.com/t/how-to-let-vehicle-avoid-vehicle-when-they-move-to-same-location/454191/5 "2019-08-23T07:19:01Z")

</div>

Thank your apply. I plane to learn about detour crowd ai controller to deal this problem.
