Questions tagged [scriptable-object]
106 questions
0
votes
1 answer
ScriptableObject resetting Array of PropertyDrawer to Length of Zero
I have a simple class called Behaviour that saves a string and a string-array. It looks like this:
[System.Serializable]
public class Behaviour {
public string Methodname;
public string[] Parameters;
}
As you might already expect, this class is…

Kevin
- 5
- 3
0
votes
2 answers
Unity Broken text PPtr when saving asset
I recently upgraded my version of Unity 2021.1 and now when I call AssetDatabase.SaveAssets(), I get the error
[Worker0] Broken text PPtr in file(Assets/Game/Dialogue/Dialogue.asset). Local file identifier (1528208011795455128) doesn't exist!
I…

Chris
- 51
- 1
- 8
0
votes
1 answer
Unity ScriptableObject pass object reference and when object is edit the SO keep those changes
I have a SO that contains some data:
[CreateAssetMenu(fileName = "Map Information", menuName = "Map", order = 0)]
public class Map : ScriptableObject
{
public Terrain[] tiles;
}
Terrain is a class:
public class Terrain
{
//things and…

Yoaquin
- 1
- 1
0
votes
1 answer
get all public variables from Scriptable Object
This script works, but its quite tedious. As I have to manually code a for loop for each ItemData[] variables in the itemDB.
Question: Is there a simpler way to get all the variables in the ItemDB ScriptableObject?
public class InventoryManager :…

Herschel
- 23
- 6
0
votes
1 answer
Instantiate scriptableobject with random variables
I just started to work with scriptableobject, and I'm trying to Instantiate / Create Instance of a very basic scriptableobject that got 4 line of arrays.
I'm trying to Instantiate one scriptableobject that I created, that every time he's been…

Chen Robin
- 41
- 7
0
votes
1 answer
Are scriptable object causing Unity Editor to lag?
So to make it simple, I am working with ScriptableObject in my project, all of a sudden i tried to add one more and the editor became so laggy that I can't keep working on the project it's way too annoying to handle...
I have creating a lot of…

Tanguy HELLER
- 39
- 8
0
votes
1 answer
Why does the last element instantiated on a layout group appear as first and wrong?
I am programming a card game in unity and need the cards drawn to be displayed on a UI area bound by a Horizontal Layout Group, the cards are scriptable objects written in advance and displayed when drawn, but for some reason the last card of the…

Grushnack
- 1
- 3
0
votes
0 answers
Why is my bool value, set within a ScriptableObject, not being updated in another script?
I have a problem with my bool value that I dont understand. I have an Actions script, which derives from MonoBehavior. In that script I have a bool variable "IsCompleted", which shall indicate whether an Attack is finished or not. In Awake there I…

Fledermauserl
- 35
- 9
0
votes
1 answer
Scriptable Objects Reorder Parent/Child when renamed
How I got here: I have been working on a tool that uses scriptable objects which have child scriptable objects. The system works really well, however when I rename the SO the parent/child relationship breaks in Unity.
I have managed to get this down…

wbdev
- 581
- 1
- 4
- 6
0
votes
1 answer
Unity scriptable object only serializing the unity objects
I am trying to make a spell system. My base class for the system looks like this:
public abstract class MagicBook : ScriptableObject {
public Sprite bookSprite;
public float manaCost;
public float coolDown;
public bool rapidFire;
…

Override Studio
- 11
- 2
0
votes
3 answers
Unity : Singleton ScriptableObjects resets after play
I have a singleton class that contains general information about my game.
public class GeneralGameData : ScriptableObject
{
private static GeneralGameData _currentGeneralGameData;
public static GeneralGameData CurrentGeneralGameData
{
…

mahdi movahedian
- 11
- 1
- 3
0
votes
0 answers
NullReferenceException using ScriptableObjects in Unity
I have setup a Scriptableobject in database called "Card" and am attempting to make a searchable list of those items in the scriptableobject. I attached CardDatabase script to an empty gameobject called _CardDatabase. I am not sure if I am…

jason
- 1,132
- 14
- 32
0
votes
2 answers
Looking for a better solution than using strings within Scriptable Objects to call specific methods elsewhere
I was asked to describe my use case in a previous version of my question. As such this post is quite detailed and goes into specifics about what I'm trying to do. If you arrived at this question hoping it would help you with your own problem, here…

QuietPenguin
- 17
- 3
0
votes
1 answer
Unity Scriptable Objects issue
I have a list in RoomSO that contains premade ButtonSOs that i created in the editor and dragged and dropped into the list. RoomSO is also premade (made in the editor) Then at runtime i create an instance of a ButtonSO and tried adding it to RoomSO…

user14285936
- 3
- 3
0
votes
1 answer
How can I add each instance of a scriptable object to a collection?
hello :)
I wish to add each and every instante of an scriptable object class to a HashSet (which is in a static class in a separate script). I did this by creating a method that adds said class to the hashset and I called this method in the…
user12848525