"Invisible collider" when re-enabling level gameobjects

Hello Aron,

I noticed a strange bug - some invisible collider on the A* Pathfinding gameobject. See attached video:

In the beginning, just for comparison, you can see that everything works fine… the effects of the weapon are shown correctly.
Marked in the hierarchy is the current level “World01_Room22”.

0:25 - I load a different level “World01_Main”, and deactivate the gameobject with the first level “World01_Room22” (caching that first level for later use).

0:40 - I disable the current level gameobject “World01_Main”, and activate the gameobject with the first level “World01_Room22”.

1:05 - the player passes said “invisible collider”, and from now on many of the effects are strangely “pulled towards outside of the collider” - basically towards the “last grounded position outside of that collider”.

1:27 - I cannot see any collider inside the scene view.

1:45 - I finally found out that when I remove the A* Pathfinding gameobject, that collider disappears and from then on everything works fine.

A* Pathfinding Version 4.3.83
I also tried 4.3.84 - same issues.

As always: thanks for your great support :slight_smile:

Greetings
Denzi

I forgot to mention that whenever I load a scene, or enable a cached “scene gameobject”, I do run this code as a coroutine:

        public static IEnumerator ScanNavMeshs()
        {
            // wait for any running scans...
            while (AstarPath.active.isScanning)
                yield return Game.Coroutines.WaitForEndOfFrame;

			// scan new level.
			foreach (var progress in AstarPath.active.ScanAsync())
                yield return Game.Coroutines.WaitForEndOfFrame;
        }

Hi

It’s very hard to see in your video.
The A* object shouldn’t cause any physics interactions, though.

Ok … now I don’t know what else to do :slight_smile:

I removed all kinds of running GameObjects, and nothing changed…
As soon as I remove A* Pathfinding, the invisible collision is gone…

We had “something similar” in this thread, too:

There also was a “secret collider” or something involved, that pushed the bullets away … see the 2nd video from that thread (you can see it at ~1:00)

Just found out that if I pause the game and then press the “Scan” button, the issue is fixed… Totally forgot about that button :man_facepalming:

See in the video … around 0:15 I press the button, then it runs

Just checked it … still occurs on 4.3.85

I tried with 4.3.87, and even tried your idea from the other thread: scan 2x from code…

I thought that would make a difference… but still, the only way to fix this is to press the “scan” button in the editor.

The question is, what would be the difference between scanning from code, and scanning from button? :thinking:

There should be no difference. They literally call the same method.
Could you debug it by setting A* Inspector → Settings → Graph Coloring = Navmesh Border Obstacles?

Sure, here you are…

Not sure what I am seeing there?! :smiley:

Do you have multiple graphs in your scene? It looks like it.

Also. It’s really hard for me to tell where the invisible collider is supposed to be. I can’t exactly see your button presses, so I don’t know where your character can’t go.

1 Like

Interesting… I tracked it down to a RichAI still being enabled on the PlayerController gameobject… I saw a blue line in the scene window (when I disabled all unneeded graphs :wink: ) …

A blue line going from the player … now I had to find out which script by disabling each running script manually (stupid Unity should have more search/multiselect to disable gizmos :rage:)

The player is using the RichAI whenever s/he enters or leaves a room, to find the “outside” position…

However, if I disable it when it is not needed, everything works fine…

Strange thing is, why the RichAI suddenly is pointing towards a “random point”, when it doesn’t do this in most of the scenes?!?

Anyway, I have a solution - disable unneeded RichAI :slight_smile:

Thanks for your patience and help :smiling_face_with_three_hearts:

1 Like