Search Unity

Cant give player a reward, because function OnUnityAdsDidFinish crashes outside of editor

Discussion in 'Unity Ads & User Acquisition' started by Noctre, Sep 7, 2019.

Thread Status:
Not open for further replies.
  1. Noctre

    Noctre

    Joined:
    Dec 30, 2018
    Posts:
    3
    So I am making a simple mobile game where you have to pass a level.
    If you run out of lives I want to give a player a second chance by letting them watch a rewarded video.

    Problem is that when the before mentioned method is called everything works fine in editor, but on phone I get this error:
    UnityException: GetComponentFastPath can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.

    I set up the UnityAdsListener from this guide

    Edit:
    Resolved problem by using booleans to "call" methods instead of caling a C# method directly
     
    Last edited: Sep 8, 2019
Thread Status:
Not open for further replies.