Since the AC update1.7X/1.75, the script in game 2Dcamera error appear when changing scene and I can`t drag it anymore, it was worked before any suggestion please.
(unity version 2021.3.4 & Last AC)
MissingReferenceException: The object of type 'GameCamera2DDrag' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Component.GetComponent[T] () (at :0)
AC._Camera.get_Camera () (at Assets/AdventureCreator/Scripts/Camera/_Camera.cs:295)
AC.GameCamera2DDrag._Update () (at Assets/AdventureCreator/Scripts/Camera/GameCamera2DDrag.cs:120)
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Aru.
Can you share details on how your camera is set up? Is it part of the scene you're entering, or the one you're leaving?
Any screenshots you can share of where it is in the Hierarchy will help me understand the situation.
Thanks Chris
Yes, It
s a part of each scene the main Camera I used in Default cam, here is my setup and the error I got after scene change, when I go in to the new scene I can
t move the cam anymore.https://imgur.com/Uxz4g5F
https://imgur.com/xdOS55f
Recreated, thanks for the details.
To fix it, open up AC's GameCamera2DDrag script, and find the OnDisable function around line 111. Inside that, replace:
with:
Excellent! It`s work again now thanks Chris