- Home /
Chartboost delegate not working on 2nd scene load
So I import Chartboost and it's working in the device it displays ads. But I had a problem when touch goes through impressions so I tried to listen to the correct events and disable touch when an ad is visible. It works the first time but when I reload the scene ads display but events are not working.
I have my scene like this:
-SplashScreen: Here is where I have my Chartboost Gameobject with don't destroy and my Chartboost script with display ads and events.
-Main Menu + Level: First time I load this scene after SplashScreen events work but when I touch a go to main menu button to reload this scene it's not working.
This is how I subcribe/unsubscribe to events:
void OnEnable(){
Chartboost.didDismissInterstitial += didDismissInterstitial;
Chartboost.didCloseInterstitial += didCloseInterstitial;
Chartboost.didClickInterstitial += didClickInterstitial;
Chartboost.didDisplayInterstitial += didDisplayInterstitial;
}
void didDismissInterstitial(CBLocation location) {
Input.UseTouch = true;
Time.timeScale = 1;
Chartboost.didDismissInterstitial -= didDismissInterstitial;
}
void didCloseInterstitial(CBLocation location) {
Input.UseTouch = true;
Time.timeScale = 1;
Chartboost.didCloseInterstitial -= didCloseInterstitial;
}
void didClickInterstitial(CBLocation location) {
Input.UseTouch = true;
Time.timeScale = 1;
Chartboost.didClickInterstitial -= didClickInterstitial;
}
void didDisplayInterstitial(CBLocation location){
Input.UseTouch = false;
Time.timeScale = 0;
Chartboost.didDisplayInterstitial -= didDisplayInterstitial;
}
@$$anonymous$$ Did you find any solution to your problem? I am in similar situation and have tried many things. its still not working
$$anonymous$$ight be a bug with the old version, same for me. Any solution?
Your answer
![](https://koobas.hobune.stream/wayback/20220613171233im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Can I use a delegate/event in Unity3D? 2 Answers
C# and JavaScript Event system causing 1 Answer
Chartboost check interstitial has been closed 0 Answers
Admob iOS Rewarded Videos don't close 0 Answers
Chartboost didCompleteRewardedVideo event not working 0 Answers