Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Inspector values not being used!

Discussion in 'Editor & General Support' started by zastroph, Aug 20, 2020.

  1. zastroph

    zastroph

    Joined:
    Aug 13, 2017
    Posts:
    7
    If I edit some thing in the inspector, the new values are not being used at run time!

    There are no errors or warnings at run time.
    There are no scripts at run time setting my objects to the old values.

    It simply reverts to older values in my objects.
     
  2. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Does this happen with all scripts, or a particular script?

    Have you added debug.log statements/used a debugger to verify this?

    Are the values reverting in the inspector? Or is it a case where the script's aren't using the values you assign to them in the inspector?

    (We need more information in general)
     
  3. zastroph

    zastroph

    Joined:
    Aug 13, 2017
    Posts:
    7
    For example one object is a scriptable object. It has an audioclip than I wanted to change. It does reflect this change when viewed both in editor and at run time. But after changing the audioclip and re running the game, it still plays the old audioclip and not the newly selected on!
     
  4. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    How are you playing this audio clip? Is it a MonoBehaviour in the scene that references the scriptable object?