Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

get_isPlaying is not allowed to be called during serialization

Discussion in '5.4 Beta' started by Hyp-X, Apr 19, 2016.

  1. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438
    I get this error during build creation:
    get_isPlaying is not allowed to be called during serialization, call it from Awake or Start instead.
    It's because Application.isPlaying is used from an OnValidate() event handler.

    If Application.isPlaying is not allowed to be called, what is the current supported way of determining if we are in play mode or not?

    (This is used with code that has to run when the player changes some properties on the fly - so putting it in Awake or Start is obviously not an option.)
     
  2. lukaszunity

    lukaszunity

    Administrator

    Joined:
    Jun 11, 2014
    Posts:
    461