Jump to content

Index Out Of Bounds Error Fails Application


Recommended Posts

I am using multiple Pegasus Managers to create a scene. While the scene often runs without issue, I frequently and randomly get an Index Out Of Bounds Error. Here is the full traceback:

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <XXXXXXXXX>:0)
Pegasus.PegasusPoi.CalculatePositionLinear (System.Single percent) (at Assets/Pegasus/Scripts/PegasusPoi.cs:752)
Pegasus.PegasusPoi.CalculateProgress (System.Single percent, System.Single& velocity, UnityEngine.Vector3& position, UnityEngine.Quaternion& rotation) (at Assets/Pegasus/Scripts/PegasusPoi.cs:707)
Pegasus.PegasusManager.CalculateFlythroughUpdates () (at Assets/Pegasus/Scripts/PegasusManager.cs:1235)
Pegasus.PegasusManager.LateUpdate () (at Assets/Pegasus/Scripts/PegasusManager.cs:1196)

Looking into this, the error occurs during the Lerp's between one point and another. I say this occurs randomly because I can run the program without issue and then run it again without making any changes and the error occurs. It can also happen to multiple Pegasus managers (the number of Pegasus Managers this affects is also seemingly random), and when it happens to at least one the whole application freezes. The error usually occurs right after the first frame, so I see a bit of movement and then the application fails with the above error.


System information:

Unity Version 2021.3.13f1

Pegasus Version 2.5.3

Operating System Mac OS Monterey

Link to comment
Share on other sites

Thank you for this information we will look into these errors. 


  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Hi @ProdigiousMike, we looked into the issue but were unable to reproduce the problem. We can create and edit a path, including adding and removing waypoints, without producing the error. 

The error happens when the code tries to access a Pegasus POI from a list of points, but the requested point is larger than the list of available points. (e.g. trying to access point 7 of 6 possible points)

We assume that this constellation could occur if the list of Pegasus waypoints is edited after the creation in an unexpected fashion that somehow affects the internal handling.

We can, at the moment, not fix the error as we are unable to reproduce it. If you can give us steps to reproduce the issue reliably or send us a project where a Pegasus Manager is in this broken state where it will occasionally crash, we might be able to fix the problem.

If you need a way to upload a project for us to investigate, please let us know, and we will supply you with an upload link.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

  • Create New...