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