Questions tagged [scriptable-object]
The scriptable-object tag has no usage guidance, but it has a tag wiki.
scriptable-object
118
questions
1
vote
1
answer
47
views
ScriptableObject changes in Awake() not displayed in Inspector until after Unity restart
I've created a ScriptableObject class MySO that gets modified in its Awake() function. I also added EditorUtility.SetDirty(this); as its last command. The class has a List<someOtherClass> myList ...
1
vote
0
answers
38
views
Unity Instantiate ScriptableObject returns null in build mode
I am new to Unity. My Unity version is 2022.3.21f1c1.
I have a class called CardData which is inherited from ScriptableObject:
public class CardData : ScriptableObject
{
public string ...
1
vote
0
answers
36
views
A non-null variable results me to NullReferenceException [Unity] [duplicate]
I've been on Unity for a very long time, yet I've come across the most common error.
I made a script to create a ship components store from a list of ScriptableObjects.
Here's the ScriptableObjects:
...
0
votes
2
answers
46
views
Calculate amount with value and calculation type (set, fixed, seconds, persentages, second persentages) and have the correct stat changed
I need help with the following.
Calculate with only a amount variable and an enum to set what type of calculation so i can set the correct stat value to a stat.
Make sure the correct stat gets changed....
1
vote
1
answer
27
views
UnityEvent inside Scriptable Objects
I think i run into a pretty basic problem.
Basically im trying to create a Scriptable Object class called GameEvent. This SO contains a UnityEvent.
The idea is to associate a bunch of methods to it ...
0
votes
0
answers
16
views
Unity ScriptableObjects being deleted on other machines when pushing to GitHub
A few days ago, I decided to create some structure to my unity project by moving ScriptableObjects (SO) into more detailed folders instead of keeping them all under ScriptableObjects.
After pushing ...
1
vote
1
answer
63
views
Declare variables with dynamic enum type in scriptable object
I’m writing a scriptable variable for the enum variable and would like it to be dynamic so it works with all enum types from the project.
Meaning as a first step, in inspector, I should be able to ...
0
votes
1
answer
46
views
Unity sciprtableobject containing just a list of 2 element arrays
I'm attempting to put a list of 2 element arrays into a scriptable object. I've finally managed to avoid all compiler issues, but I'm not getting anything to populate in the inspector. I'm thinking I ...
0
votes
0
answers
59
views
Unity Scriptable Object Assigned value not updated in runtime
I'm using a scriptable object as my units database, and each unit has it's own UnitStats script to load stats from the database in Start() method. It works all fine until today when I make changes to ...
-1
votes
2
answers
39
views
Scriptable object, same object with individual values
I have tried every method.
For example i created a BasicGun from this attributes.
My character can equip more than 1 from this gun.
But values are not acting individually.
For example i have a ...
0
votes
2
answers
847
views
How to show a read-only variable in the Inspector?
using System;
using UnityEngine;
[CreateAssetMenu(fileName = "Weapon", menuName = "Item/Weapon")]
public class WeaponItemSprite : ItemTypeScriptableObject
{
public GameObject ...
0
votes
0
answers
79
views
Using ScriptableObject instead of Enums in Unity, overcomplicated for this use case?
I've read through : Use ScriptableObject-based Enums in Your Project | Unity and a few threads here and agree with the following:
Enums in the editor are a ticking time-bomb that will destroy ...
0
votes
1
answer
65
views
Scriptable Object Events Cannot Register Listeners (records type mismatch) in Unity
I'm trying to follow a tutorial for handling events with scriptable objects which I found on Youtube, which is located here: https://www.youtube.com/watch?v=7_dyDmF0Ktw
As a result, I've got two ...
0
votes
2
answers
166
views
Editor script: refer to selected ScriptableObject
Another way to phrase this question would be "Get ScriptableObject from selection in editor code".
I have a public class DialogueObject : ScriptableObject from which I create many SOs. I'd ...
0
votes
2
answers
199
views
How to Handle Scriptable Object Items that have to change Data at runtime?
I have an Item class that stores ItemSO scriptable object
public class Item : MonoBehaviour
{
[SerializeField] private ItemSO inventoryItem;
}
My Item SO is an abstract class that stores general ...