#DDOL
1 messages · Page 1 of 1 (latest)
oh okay
we’ll do one at a time
let’s do rowsParent first. What type is it?
are you able to hop in a call and i can better explain this?
i’m unable to
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
i have to go soon, so i can’t help completely
anyways my way of doing it would be to:
have rect transform access the variable off of UserProfile and then assign itself
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
I tried that and i got that one error: cant convert UserProfile to Transform error
is UP a transform?
no userprofile is the name of the script
this void start should be on the rect transform game object
not the DDOL UserProfile game object
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;
}
Is there a rowsParent on every scene or just the first one?
Like i said there I copied the whole leaderboard game object to the start scene just to see if it would work (which it does) but where I actually want is in the HOME scene but all the things like rowParent and Flowchart are destoryed becasue they arnt the same in the HOME Scene
actually, there’s one more experiment i want to try before adding any more code.
Can you group everything you want in the DDOL under one game object, then DDOL that one game object
like in unity make a game objected called DDOL and then place UserProfile as a child in it?
sure, and the rect transforms and everything else as well
Says that DDOL doesnt exsist in this context
you need to create a GameObject variable and drag it in
or actually just DontDestroyOnLoad(transform.root.gameObject); and remove the rest of the DontDestroyOnLoad calls
I’ve got to go now
you avalible at all tomorrow?
if that doesn’t fix it, you’ll have to reask it in beginner, i’m closing the thread
no