Search Issue Tracker

By Design

Votes

1

Found in

2017.2.0b3

Issue ID

930177

Regression

No

NullReferenceException in MobileControlRig.EnableControlRig after switching platform in Editor

Deployment Management

-

Steps to repro:

1. Open attached project;
2. Go to BuildSettings (File -> Build Settings);
3. Select any other available platform (i.e. WebGL);
4. Click Switch Platform.

Expected result:
Platform is switched without errors.

Actual result:

Error:

NullReferenceException
UnityStandardAssets.CrossPlatformInput.MobileControlRig.EnableControlRig (Boolean enabled) (at Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs:89)
UnityStandardAssets.CrossPlatformInput.MobileControlRig.CheckEnableControlRig () (at Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs:82)
UnityStandardAssets.CrossPlatformInput.MobileControlRig.OnActiveBuildTargetChanged (BuildTarget previousTarget, BuildTarget newTarget) (at Assets/Standard Assets/CrossPlatformInput/Scripts/MobileControlRig.cs:98)
UnityEditor.Build.BuildPipelineInterfaces.OnActiveBuildTargetChanged (BuildTarget previousPlatform, BuildTarget newPlatform) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:345)
UnityEditor.Build.BuildPipelineInterfaces:OnActiveBuildTargetChanged(BuildTarget, BuildTarget)

is thrown in the console. See attached video.

Notes:
- Reproducible in 2017.2.0b3, 2017.1.0f3;
- The code doesn't compile in 5.6.1p2;
- Reproducible on Windows 10;
- Uncommenting line 82 in 'MobileControlRig.cs' script fixes the issue.

Comments (12)

  1. pRob3

    Oct 13, 2017 12:01

    Also got this bugg when trying to build for OSX on my PC.

  2. alexwood87

    Aug 12, 2017 02:52

    This also happens in 2017.2.0b6 when switching to IOS or Android from any platform.

Add comment

Log in to post comment