unity-movement-ai
unity-movement-ai copied to clipboard
flocking issues - Screen boundry
MissingComponentException: There is no 'Rigidbody' attached to the "ScreenBoundary" game object, but a script is trying to access it. You probably need to add a Rigidbody to the game object "ScreenBoundary". Or your script needs to check if the component is attached before using it. UnityEngine.Rigidbody.get_position () (at C:/buildslave/unity/build/artifacts/generated/common/modules/Physics/DynamicsBindings.gen.cs:1536) Cohesion.getSteering (ICollection`1 targets) (at Assets/unity-movement-ai/Scripts/Movement/Cohesion.cs:28) FlockingUnit.Update () (at Assets/unity-movement-ai/Scripts/FlockingUnit.cs:35)
No such issue exists for other Example scenes. I am using unity 5.3.4
Are you using ScreenBoundary
inside of your own project? I think the master
branch version of unity-movement-ai
relies on Physics project settings to make sure the screen boundary is not sensed.
In the dev
branch (which is vastly different from the master branch) I have made my code just ignore any collider without a MovementAIRigidbody
(which is basically just a wrapper class for the library to be able to work with Rigidbody2D
and Unity's 3D Rigidbody
).