Questions tagged [scriptable-object]

106 questions
0
votes
0 answers

Null reference Exception for Scriptable Object instance, but then it actually works?

I am making an SO with the definition for an Enemy, like this: public class Enemy_SO : ScriptableObject { public string enemyName; [Header("AI Agent Settings")] public int speed; public int angularSpeed; } And I am attaching…
Wolfeius
  • 303
  • 2
  • 14
0
votes
0 answers

Counter not updating on unity UI but the variable is

In the fishing mini game I'm working on, each unique fish that the player catches is written to a "journal" type UI. If the player has caught that type again, instead of writing a whole new entry to the UI, a score increments by 1 to show how many…
0
votes
1 answer

How to print a randomly selected string from Scriptable Objects in Unity?

I want to randomly pick an item from a scriptable object and then print the randomly chosen item to the console. using System.Collections; using System.Collections.Generic; using UnityEngine; [CreateAssetMenu(fileName = "Country",…
0
votes
1 answer

Is ScriptableObject a good database design?

I'm trying to make a simple game database, containing simple items. My database is simply a ScriptableObject, containing a list of other ScriptableObject (Items) that holds informations about items and hold a string key. var item =…
dvr33
  • 145
  • 1
  • 3
  • 11
0
votes
1 answer

Serialize Script Instance in a ScriptableObject in Unity

I know this can be done because the amazing plugin Odin, has some epic serialization tools. I was hoping I could do this using Odin but even their [Serialize] tag doesn't work. I want to serialize a new instance of a script inside of a Scriptable…
Aggressor
  • 13,323
  • 24
  • 103
  • 182
0
votes
1 answer

Confusion regarding scriptableObject

When we still make multiple copies/Instances of ScriptableObject then how is it good for memory optimization.? In Past, scripts were attached to prefabs and on instantiation, every script was used to create/reserve its own slot in memory, which was…
0
votes
1 answer

Import Sprite from a file on the Computer and reference it in a Scriptable Object Instance

Character ScriptableObject I have a ScriptableObject "Character" and I have a created an instance of it. It has a field for a Sprite but I don't want to reference it before starting the game. Character.cs public Class Character : ScriptableObject…
0
votes
1 answer

Issues with Save/Load System in a Text Based Adventure game made with ScriptableObjects in Unity

I am almost done with my Text Based Adventure Game and am trying to setup a Save/Load system that works. I can't seem to accomplish this. I have viewed multiple tutorials and I feel that Json may be what I need. Unfortunately I can't seem to get…
0
votes
2 answers

Reload Assembly for access to new ScriptableObject script type

I am creating a new script from a template. However, this new script type is not accessible until the Assembly has had a chance to re-compile. I am trying to create an instance of the new ScriptableObject, in order to generate it through…
-1
votes
0 answers

How to Automatic Select Dropdown and Auto Click button

Here I have an auto-login script and an HTML script for the main Dashboard page My Script Auto Login : const username = "test"; const password = "test"; const webView = new WebView(); await…
Ripo
  • 1
  • 2
-1
votes
1 answer

Serializing struct list that includes Scriptable Objects using JsonUtility

I am pretty new to Unity and c# and I was trying to save a list of the struct that contains attributes including a Scriptable Object using JsonUtility; however after serialization when I check the JSON file and it did not seem to record the…
-1
votes
1 answer

How to instantiate a randomly picked ScriptableObject?

Im new to Unity and c#, I've been making a turn based game following one of Brackeys tutorial and i've added scriptable objects to it. Im looking to instantiate a random enemy everytime a fight starts. Here's the lines that should be useful :…
Zodi
  • 1
-1
votes
1 answer

Is a Mouse Manager as a ScriptableObject viable?

I am trying to wrap my head around ScriptableObjects and their possibilities. My goal is to have a Mouse Manager that keeps track of the mouse position, objects it's hovering over, and other behaviors. I want this manager to be read by anything that…
Justin Anthony
  • 416
  • 1
  • 3
  • 13
-2
votes
1 answer

Scriptable objects are not saved when the project window is cycled

When you eat an item, the item is added to the scriptable object. And when UNI.T turns off and on, the items you ate are saved well. However, if you cycle the project, it will not be saved. I made scriptable object again and looked at scriptable…
-3
votes
1 answer

Unity: How To Assign ScriptableObject Instance In Editor Code

Want to access ScriptableObject data from an editor code, namely a custom Node Graph Editor code: Create a ScriptableObject containing Color field. Create an instance of that SO and set the Color in the inspector. Acquire that SO instance from an…
1 2 3 4 5 6
7