#DDOL

1 messages · Page 1 of 1 (latest)

left comet
#

@subtle hazel

subtle hazel
#

oh okay

left comet
#

we’ll do one at a time

subtle hazel
#

okay

#

Im trying to get the table transform

left comet
#

let’s do rowsParent first. What type is it?

subtle hazel
#

are you able to hop in a call and i can better explain this?

left comet
#

i’m unable to

subtle hazel
#

okay. Ill try to my best to descibe it then

#

rowsParent is a rect transform

#

would it be easier to bring the whole UI and game object in from the Start scene? It does work in there. Its just I made a copy of the game object and put it in the Home Scene and now it doesnt work

#

You can see I am not in play mode there and all the values are there. they just disappear when i switch scenes. I am wondering if it would be esaiser to bring in the whole PANEL- Leaderboard

left comet
#

i have to go soon, so i can’t help completely

left comet
#
void Start()
{
      UserProfile profile = UserProfile.UP;
       profile.rowsParent = this;
}```
#

that’s what this is

#

In the start method the rect transform accesses the Static variable, and then assigns rows parent

subtle hazel
subtle hazel
left comet
#

which line is throwing the error

#

the top one or bottom one

subtle hazel
#

Profile.rowParent = this;

#

specificlly the word this

left comet
#

not the DDOL UserProfile game object

subtle hazel
#

im not sure what you mean

#
using System;
using System.Collections;
using System.Collections.Generic;
using PlayFab;
using PlayFab.ClientModels;
using UnityEngine;
using UnityEngine.UI;
using PlayFab.MultiplayerModels;
using TMPro;
using Fungus;
using PlayFab.Networking;
using Mirror;
using PlayFab.AdminModels;
using Newtonsoft.Json;

public class UserProfile : MonoBehaviour
{

    public GameObject rowPrefab;
    public Transform rowsParent;
    //public AgentListener agentListener;
    // public Configuration configuration;
    public Flowchart flowchart;
    public static UserProfile instance;
    public static UserProfile UP;
    public static int glimmers;
    public Text ErrorMessage;

    [Header("UI")]
    public TMP_Text glimmersValueText;
    [SerializeField] ProfileData profileData; 


    void OnEnable()
    {
        UserAccountManager.OnSignInSuccess.AddListener(SignIn);
        UserAccountManager.OnUserDataRetrieved.AddListener(UserDataRetrieved);
        ErrorMessage.text = "";
          if(UserProfile.UP == null)
         {
            UserProfile.UP = this;
        }
        else
        {
            if(UserProfile.UP != this)
            {
                Destroy(this.gameObject);
            }
        }
        DontDestroyOnLoad(this.gameObject);
        DontDestroyOnLoad(rowsParent.gameObject);

    }

    private void Awake() {
        instance = this;
        UserProfile.instance.rowPrefab = rowPrefab;
        UserProfile.instance.rowsParent = rowsParent;
    }
left comet
subtle hazel
left comet
subtle hazel
left comet
subtle hazel
left comet
left comet
# subtle hazel

or actually just DontDestroyOnLoad(transform.root.gameObject); and remove the rest of the DontDestroyOnLoad calls

#

I’ve got to go now

subtle hazel
#

you avalible at all tomorrow?

left comet
#

if that doesn’t fix it, you’ll have to reask it in beginner, i’m closing the thread

left comet