Hello. It’s me again.
I’m trying to force a squad to abruptly stop when going into battle mode. I don’t use local avoidance and physics engine. To begin with, I want to create a constantly updated list of characters that stuck together when moving. Then, during sudden braking, set new coordinate points for such a character so that they go a little into the free space. What are the ways to do this? Is it possible somehow through the rays? Or is it still better to hang up the “Rigidbody” component for everyone?
I also found in the documentation such a function “Physics.OverlapSphereNonAlloc”. Has anyone used it for this? How to make a list?
Hello. It’s possible to create pseudo physics in order to manage avoidance and other events. What we call Physics under an engine is not the same as reality. All are algorithms and other stuff. You can do your own Physics according to your will. I would like to recommend you to study a simple AABB (axis-aligned bounding box) system which allows the creation of behavior for objects - something similar with colliders.
You can use a simple Distance detection. Then you call your range Battle function…
The fact is that I studied programming on the YouTube video “C # in an hour”, and I opened the visual studio for the first time last year. Such things are beyond me. If I had not stumbled upon the pathfinding library by accident, I would probably have abandoned everything.
There is no physics/pseudophysics in the original. But there is a problem I described above. It was solved by teleporting the characters to other positions.
If the simplest solution is [quote=“Geckoo, post:2, topic: 882328, username:Geckoo”]
simple Distance detection
[/quote]
. Then how to do it?