A strange bug has been found

cangcloud

Member
I found a strange bug. I hope you can fix it. You can watch my screenshots and recorded videos. This bug is very strange... As long as you click main camera, you will create many meaningless game objects. You can see my screenshots with error messages.
1619957272089.png
 
Last edited:
Can you list the steps to reproduce from a fresh project?
This problem is really strange. Did other users not find this problem? You can watch the video I recorded. Maybe you should test it on Unity2011.1.5. There will be a Unity2021 LTS version next year. You should pay attention to these problems. Test on the latest Unity version.
 
Have you tried this in a new project? Does it happen there as well?

Are there other scripts on your camera object?
 
I have tested it on Unity 2021.1 and didn't receive the same error. Can you post the full call stack of the CameraControllerInspector error? This will give me a better idea of what it is trying to do.
 
Have you tried this in a new project? Does it happen there as well?

Are there other scripts on your camera object?
Yes, I created a new scene in the recorded video. This problem also exists in the new scene. I don't know what caused it. I guess this is related to the new version of the Unity editor. I am now working with Unity2021.1.5 , You should test the new version of Unity.
 
Have you tried this in a new project? Does it happen there as well?

Are there other scripts on your camera object?
Hi, Man. I have found the reason. This problem will occur when you select Third person combat in the Camera Setup option. I now change it to Third Person Adventure and this problem will not occur. You can see my screenshot. I bought It is the Third Person Controller, which may be related to this.
 

Attachments

  • Camera问题.jpg
    Camera问题.jpg
    303.7 KB · Views: 0
Can you copy and paste the full error that you are receiving? I need to see the line number causing the problem.
 
Can you copy and paste the full error that you are receiving? I need to see the line number causing the problem.
IndexOutOfRangeException: Index was outside the bounds of the array.
Opsive.UltimateCharacterController.Editor.Inspectors.Camera.CameraControllerInspector.OnViewTypeStateListDraw (UnityEngine.Rect rect, System.Int32 index, System.Boolean isActive, System.Boolean isFocused) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Camera/CameraControllerInspector.cs:388)
UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <3164af17d5d94ab0bb0c3556307c8722>:0)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect, UnityEngine.Rect visibleRect) (at <3164af17d5d94ab0bb0c3556307c8722>:0)
UnityEditorInternal.ReorderableList.DoList (UnityEngine.Rect rect) (at <3164af17d5d94ab0bb0c3556307c8722>:0)
Opsive.Shared.Editor.Inspectors.StateSystem.StateInspector.DrawStates (UnityEditorInternal.ReorderableList reorderableList, UnityEditor.SerializedObject serializedObject, UnityEditor.SerializedProperty states, System.String selectedIndexKey, UnityEditorInternal.ReorderableList+ElementCallbackDelegate drawCallback, UnityEditorInternal.ReorderableList+AddCallbackDelegate addCallback, UnityEditorInternal.ReorderableList+ReorderCallbackDelegate reorderCallback, UnityEditorInternal.ReorderableList+RemoveCallbackDelegate removeCallback) (at Assets/Opsive/Shared/Editor/Inspectors/StateSystem/StateInspector.cs:84)
Opsive.UltimateCharacterController.Editor.Inspectors.Camera.CameraControllerInspector.DrawSelectedViewType (System.Int32 index) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Camera/CameraControllerInspector.cs:364)
Opsive.UltimateCharacterController.Editor.Inspectors.Utility.ReorderableListSerializationHelper.DrawReorderableList (UnityEditorInternal.ReorderableList& reorderableList,
Opsive.Shared.Editor.Inspectors.InspectorBase inspector, System.Array drawnObject, System.String serializedData, UnityEditorInternal.ReorderableList+HeaderCallbackDelegate drawHeaderCallback, UnityEditorInternal.ReorderableList+ElementCallbackDelegate drawElementCallback, UnityEditorInternal.ReorderableList+ReorderCallbackDelegate reorderCallback, UnityEditorInternal.ReorderableList+AddCallbackDelegate addCallback, UnityEditorInternal.ReorderableList+RemoveCallbackDelegate removeCallback, UnityEditorInternal.ReorderableList+SelectCallbackDelegate selectCallback, System.Action`1[T] drawSelectedElementCallback, System.String key, System.Boolean requireOne, System.Boolean
indentList) (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Utility/ReorderableListSerializationHelper.cs:91)
Opsive.UltimateCharacterController.Editor.Inspectors.Camera.CameraControllerInspector.<GetDrawCallback>b__13_0 () (at Assets/Opsive/UltimateCharacterController/Editor/Inspectors/Camera/CameraControllerInspector.cs:150)
Opsive.Shared.Editor.Inspectors.StateSystem.StateBehaviorInspector.OnInspectorGUI () (at Assets/Opsive/Shared/Editor/Inspectors/StateSystem/StateBehaviorInspector.cs:92)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <b0c6c7bf97154d4994cbc2e652831a43>:0)
UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr, Boolean&)
 
Looks like it's trying to select a view type that's not in the array. Are you able to open the CameraController component's "View Types" and select a different view type? Or does the inspector not work due to the error?
 

Attachments

  • Untitled.png
    Untitled.png
    34.9 KB · Views: 2
Looks like it's trying to select a view type that's not in the array. Are you able to open the CameraController component's "View Types" and select a different view type? Or does the inspector not work due to the error?
Once the Main Camera is selected, a lot of meaningless GameObjects will be created continuously. I didn't do anything. I just selected the Third person Combat in the Camera Setup. This problem appeared when I clicked the Setup Camera button. You can do it yourself. Give it a try, I now choose Third Person Adventure and this problem will not occur. For the specific situation, you can watch the video I recorded, the scene is just created by me.
 
Looks like it's trying to select a view type that's not in the array. Are you able to open the CameraController component's "View Types" and select a different view type? Or does the inspector not work due to the error?
You should take a look at this, I think you will find the problem and solve it.
 

Attachments

  • CameraBug.JPG
    CameraBug.JPG
    549.8 KB · Views: 4
It doesn't look like a bug but rather an issue with how the camera is set up.

Here is something to test. If you open the demo scene can you click around on the camera? If you can, then the issue is something in your scene, if the issue is in the demo scene as well then the issue is something with your files and is possibly a bug.

In my project, with the latest UCC package (though Unity 2019.4.25f), I can toggle between Combat and Adventure mode no problem in the editor.
 

Attachments

  • adventure.PNG
    adventure.PNG
    668.7 KB · Views: 2
  • combat.PNG
    combat.PNG
    680.1 KB · Views: 2
Last edited:
It doesn't look like a bug but rather an issue with how the camera is set up.

Here is something to test. If you open the demo scene can you click around on the camera? If you can, then the issue is something in your scene, if the issue is in the demo scene as well then the issue is something with your files and is possibly a bug.

In my project, with the latest UCC package (though Unity 2019.4.25f), I can toggle between Combat and Adventure mode no problem in the editor.
You can click main camera. Once you click main camera, many meaningless GameObjects will be created. This problem also occurs in the demo scene, but the problem in the demo scene is a little different. Clicking main camera in the demo scene will not cause this problem, but it will appear when you click Nolan characters. This problem is really strange, It may be related to the latest unity editor. Now I use unity2021.1.5 to work. You can install the unity editor and try it. I have recorded videos. For details, you can see the videos I recorded.
 
I just downloaded Unity 2021.1.5 and installed the latest version of UCC and replicated your steps and had no issues. Maybe try a new project and do a fresh install of UCC and see if you are still getting the issue.


UCCNoErrors.PNG
 
Top