Hi

I'm seeing an issue whereby a scene changer element is taking me to another scene, however the destination scene never appears, I just get a fade to black without a fade to the destination scene.

I can make the scene change with Ork, just using a script with SceneManager.LoadScene. However with Orks Scene Changer it doesn't show the destination scene.

It was suggested that I resolve all errors before worrying.

I have two errors that seem to be related;

1) NullReferenceException: Object reference not set to an instance of an object ORKFramework.ButtonPlayerControlSettings.AddPlayerControl.

I've read here that this should only happen if the player dies, but I get this at scene start on the first scene. I've also read here that the cause might be that the inbuilt controllers aren't suitable for 2D games but....

2) Can't add component 'CharacterController' to People_11(Clone) because it conflicts with the existing 'BoxCollider2D' derived component!
UnityEngine.GameObject:AddComponent()


I also get this at scene start of the first scene.

I'm using my own controller for the player character. Just a basic script to handle up, down, left and right.

Any ideas?

  • The full error is:

    NullReferenceException: Object reference not set to an instance of an object
    ORKFramework.ButtonPlayerControlSettings.AddPlayerControl (UnityEngine.GameObject player) (at :0)
    ORKFramework.PlayerControlSettings.AddPlayerControl (UnityEngine.GameObject player) (at :0)
    ORKFramework.GameControlsSettings.AddPlayerComponents (UnityEngine.GameObject gameObject) (at :0)
    ORKFramework.ControlHandler.set_ControlledPlayer (UnityEngine.GameObject value) (at :0)
    ORKFramework.Combatants.CombatantObject.set_GameObject (UnityEngine.GameObject value) (at :0)
    ORKFramework.Combatants.CombatantObject.Spawn (UnityEngine.Vector3 position, System.Boolean setRotation, System.Single yRotation, System.Boolean setScale, UnityEngine.Vector3 scale) (at :0)
    ORKFramework.PlayerHandler.SpawnPlayer (UnityEngine.Vector3 position, System.Boolean setRotation, System.Single yRotation, System.Boolean setScale, UnityEngine.Vector3 scale) (at :0)
    ORKFramework.PlayerHandler.SpawnPlayer (System.Int32 spawnID) (at :0)
    ORKFramework.SceneTarget.SpawnPlayer () (at :0)
    ORKFramework.Behaviours.SceneChanger+d__27.MoveNext () (at :0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    ORKFramework.Behaviours.SceneChanger:OnSceneLoaded()
    ORKFramework.ORKCore:FireSceneLoaded()
    ORKFramework.ORKCore:OnSceneLoaded(Scene, LoadSceneMode)
    UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode) (at C:/buildslave/unity/build/Runtime/Export/SceneManager/SceneManager.cs:244)
  • The built-in controls are not suited for 2D, you'll have to use custom controls.

    The issue here is that the Button player control requires a Character Controller (which is a 3D collider component), but since your prefab already has a 2D collider attached, the 3D collider can't be attached (which also prevents the player controller from being attached).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I went in to the ork control settings and found a button option. Set this to None and BOOM! Fixed.

    Ta

Sign In or Register to comment.