C
C#Florian Voß

❔ Access things from different scene in Unity

I have a Class Selector scene that has a Class Selector Script component (MonoBehaviour) attached to one of it's GameObjects, see first screenshot. I have a Stat Selector scene that has a Stat Selector Script component (MonoBehaviour) attached to one of it's GameObjects. The Stat selector holds a field of type ClassSelector and I want to assign to it the ClassSelector from my ClassSelector Scene, how can I do that?
FV
Florian Voß387d ago
FV
Florian Voß387d ago
the GetRootGameObjects()throws ArgumentException: "The scene is invalid" I was hoping I could search through that for the GameObject and the Class Selector Script component attached to that GameObject Debug.Log(classSelection.rootCount) prints 0 for some reason, I dont understand why.
A
Anton387d ago
You have to load it, then wait a frame or two, then query the objects. If you're doing it in the editor, use a prefab instead and reference it in both places
FV
Florian Voß387d ago
but if I load the scene then I have two scenes loaded and displayed 🤔
S
SlimStv387d ago
You're doing it the wrong way either you want a scriptableobject or just save it to json also why you make a separate scene just for the stats?
A
Accord386d ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
FV
Florian Voß385d ago
its a StatSelector scene. The User can assign different randomly generated values to different character stats such as intelligence, strength...
A
Accord384d ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ C# how do I write an If-statement to handle a button?Hi, I wanted some assistance with writing a If-statement that filters out the zones section in my ap❔ Magnetic Links for application?Hey, does someone have an article/tutorial/explanation how I can develop magnetic links for my appli❔ Show values from a list in a datagridview getting source from bindingsourceHello! I have the following problem: I am currently developing a winforms app with a datagridview th❔ Render email content .NET 7 (razor)I have to reinplement email content rendering, because currently its not looking really good, especi❔ GetAxis wont workpublic class Driver : MonoBehaviour { // Start is called before the first frame update const✅ (SOLVED)Help a Beginneri am following CodeMonkeys 11Hr youtube video on coding a game in unity. I have ran into a issue whe❔ Exclude items from linq query if they contain one from an array of substringsI've got a list of strings, that if they appear anywhere in a linq query column i want to exclude th✅ Comprehension questions (LeetCode Binary Search)Like the title says it's about this puzzle https://leetcode.com/problems/binary-search/description/ ❔ How to create a cubic function calculator that also calculates the minimum and maximum value```c Console.WriteLine("Please enter a, b, c, d for the cubic function ax^3+bx^2+cx+d"); ❔ how to listen to the output of a virtual audio device on windows using C#?how to listen to the output of a virtual audio device on windows using C# to save the raw audio stre❔ How to wait for process to completei want to make program opens async but instead of giving 'hard coded' delays but i don't know how to❔ Problem with including C DLL in a C# console app project.So I have this C DLL imported into my console app (.NET 5). I simply cannot get to call it correctly✅ Win Form Event Handlers questionHi, I was just wondering if there is an event handler when the win form is idle that I can then run ❔ Problem with Dictionary<ulong, Image> (Strange work of memory access)Concept of my system: A system that draws a picture with stickers, each of the stickers can be moved❔ How do I refactor this?I am working with a grid of tiles, each tile has an int, which is made up of 4 bytes which represent❔ [AvaloniaUI] Visibility of item in ListView based on conditionAn Avalonia UI application is used to manage an evidence of items. It allows the user to add items. ✅ How to structure this login/signup page layoutSo I have this mockup of the layout I want for a login/signup page in my Blazor WASM app. Pretty sta❔ I am need of help before I give up and run my code on a server instead of a serverless solution.I have create an azure function locally and i've used the selenuim webdriver package for taking scre✅ .Net Core 6 Asymmetric Encryption with custom public and private keysHello all! How can i use the `Asymmetric Encryption` in .Net 6 but choosing/importing private and pu❔ No Design in C#Instances of this bug (1) 1. View Call Stack at System.Runtime.InteropServices.Marshal.ThrowExce