Hey Chris,
I have a Unity UI Prefab – a score counter, actually – that lives in world space and is supposed to show up in different scenes as part of the setting (and thus is added by AC at runtime to these scenes). As the counter sits on a draggable object, I have to set this draggable as the counter's parent in an action list after the scene has started – but Unity advises me not to:
Parent of RectTransform is being set with parent property. Consider using the SetParent method instead, with the worldPositionStays argument set to false. This will retain local orientation and scale rather than world orientation and scale, which can prevent common UI scaling issues.
UnityEngine.Transform:set_parent(Transform)
AC.ActionParent:Run() (at Assets/AdventureCreator/Scripts/Actions/ActionParent.cs:71)
AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:347)
UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:306)
AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:520)
AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:438)
AC.<RunAction>c__Iterator2:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:407)
Still the parenting works … until I change scenes; then this error comes up:
-> AC debug loggerUnityEngine.Debug:Log(Object, Object)
AC.ACDebug:Log(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:16)
AC.SaveFileHandler_SystemFile:Save(SaveFile, String) (at Assets/AdventureCreator/Scripts/Save system/FileHandling/SaveFileHandler_SystemFile.cs:95)
AC.<PrepareSaveCoroutine>c__Iterator0:MoveNext() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:865)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AC.SaveSystem:SaveSaveGame(Int32, Boolean, String) (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:815)
AC.SaveSystem:SaveAutoSave() (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:670)
AC.ActionListManager:PurgeLists() (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:662)
AC.ActionListManager:SetCorrectGameStateEnd() (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:628)
AC.ActionListManager:EndList(ActiveList) (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:541)
AC.ActionListManager:EndList(ActionList) (at Assets/AdventureCreator/Scripts/Managers/ActionListManager.cs:508)
AC.ActionList:Kill() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:624)
AC.<EndCutscene>c__Iterator3:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:553)
I have no idea what all of this means, because I am no pro coder. Am I doing something I shouldn't do?
Best, Jens
Comments
UnityEngine.Transform:set_parent(Transform)