Search Issue Tracker

Fixed in 2020.1.X

Fixed in 2019.3.X

Votes

0

Found in

2018.3.0a6

2018.4

2019.1

2019.2

2019.3

2020.1

2020.1.0a19

Issue ID

1211154

Regression

Yes

[2D] ArgumentException thrown continuously when GameObject assigned to "Connected Rigid Body" in "Relative Joint 2D " preset

Physics2D

-

On assigning GameObject to "Connected Rigid Body" under preset of the any "2D Joint" component throws ArgumentException continuously also properties under component doesn't show in the inspector, refer attached video.

Steps to repro:
1. Create a new project
2. Hierarchy > Create > Create Empty GameObject
3. Empty GameObject > Inspector > Add Component > Relative Joint 2D (Any 2D Joint)
4. Create preset of 2D Component (Relative Joint 2D)
5. Project > 2D Joint preset
6. Inspector > Connected Rigid Body > Assign GameObject

Actual Result:
ArgumentException has thrown continuously on GameObject assign to "Connected Rigid Body" in "2D Joint" preset

Expected Result:
GameObject should be assigned without any exception thrown and all properties are visible under component

Occurring with Unity
2020.1.0a19, 2019.3.0f6(69ba09c9b97e), 2019.2.13f1, 2019.1.11f1, 2018.4.14f,1 2018.3.1f1, 2018.3.0b1, 2018.3.0a6

Not reproducible:
2018.3.0a5, 2018.2.0f2, 2018.1.0f2

Environment:
Windows 10 & macOS 10.14

Stack trace:
ArgumentException: Cannot get physics scene; Unity scene is invalid.
Parameter name: scene
UnityEngine.PhysicsSceneExtensions2D.GetPhysicsScene2D (UnityEngine.SceneManagement.Scene scene) (at <70fa15663ba64f1e88ac453c5d646f7b>:0)
UnityEditor.Joint2DEditor.OnInspectorGUI () (at <b9bb103d86cd4249b6a1c8b6aa2850c7>:0)
UnityEditor.Presets.PresetEditor.DrawInternalInspector () (at <b9bb103d86cd4249b6a1c8b6aa2850c7>:0)
UnityEditor.Presets.PresetEditor.DrawPresetData () (at <b9bb103d86cd4249b6a1c8b6aa2850c7>:0)
UnityEditor.Presets.PresetEditor.OnInspectorGUI () (at <b9bb103d86cd4249b6a1c8b6aa2850c7>:0)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <b9bb103d86cd4249b6a1c8b6aa2850c7>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

  1. Resolution Note (fix version 2020.1):

    The "Preset" component feature creates components that are not added to a scene which is incompatible with the safety check that all Physics 2D joints are doing, ensuring that you don't select a Rigidbody2D that isn't in the same scene. Now that check is only done when the joint is created when using a preset. When doing this directly in the scene then it's checked as before. Verified fix in the Unity Version 2020.1.0a20.2541 Revision: trunk 019325219793.

  2. Resolution Note (fix version 2019.3):

    The "Preset" component feature creates components that are not added to a scene which is incompatible with the safety check that all Physics 2D joints are doing, ensuring that you don't select a Rigidbody2D that isn't in the same scene. Now that check is only done when the joint is created when using a preset. When doing this directly in the scene then it's checked as before.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.