Questions tagged [scriptable-object]
106 questions
0
votes
0 answers
Instantiated ScriptableObject changes affecting original ScriptableObject values
I'm using ScriptableObjects to store base information for tools, and trying to instantiate a unique SO for every tool in the game, so they all have unique values. The problem is that whenever a value in one clone is affected, the original SO in the…

Josh
- 1
- 1
0
votes
0 answers
A field with type GameObject in a class which inherits from ScriptableObject
using UnityEngine;
[CreateAssetMenu(fileName = "Sphere_SO", menuName = "ScriptableObjects/Sphere")]
public class Sphere_SO : ScriptableObject
{
public int FieldInteger;
public GameObject FieldGameObject;
}
In file .asset it is easy to…

Anonymous
- 43
- 1
- 10
0
votes
1 answer
Unity iPhone: will modifying a scriptable object at runtime on device persist across sessions?
My Unity iPhone board game has several sets of built in boards, plus one set of custom boards which starts empty and the player can add to it. Til now I’ve been using an array of ScriptableObjects (which each contain a list of pre-made boards) for…

Robin King
- 367
- 1
- 3
- 10
0
votes
2 answers
Foreach generic as specific type
Cannot resolve and find solution. I want to create easy-extend structure and save data to ScriptableObjects.
For example I create 2 AudioSettings (assets) based on SettingsSO: DefaultSettings, CurrentSettings, then I'm going to set up Default on…

Aleksei Burov
- 43
- 5
0
votes
3 answers
Only letting a string be a certain value: Scriptable Objects
I was working on a scriptable object type for any item in my game and I have a string called s_Type. I only want this string to be a certain value; "food", "story", "collectible", or "nothing". I though about using a class but it would create a loss…

Sam_003
- 13
- 3
0
votes
2 answers
Containing file and class name must match ( Scriptable Object )
I have this problem while trying to assign my scriptable object and the window which shows me the error pop-up, any idea :>>?

Đỗ Trọng Khoa
- 79
- 12
0
votes
1 answer
Generate class and get type
I want to create a new class at runtime, get the type, and create a List of that type.
For example:
void CreateNewClass(string name)
{
File file = CreateFile(name);
Type type = GetTypeOfFile(file);
List…

Pascal
- 15
- 3
0
votes
1 answer
How can I use scriptable objects for upgrade card system?
I have a question about scriptable objects. I know that making changes on scriptable objects during run time permanently affects its values.
For my use case, I'm trying to create a game (similar to slay the spire) and created a Card scriptable…

Rokugatsu29
- 3
- 1
0
votes
1 answer
How do I make an array with all Scriptable Objects from a folder in Unity?
So this is the Scriptable Object:
[CreateAssetMenu(fileName = "New Char", menuName = "Char")]
public class ScriptableChar : ScriptableObject
{
public string charName;
public Sprite charSprite;
public Sprite charBorderSprite;
public CharClass…

Kypindor
- 3
- 2
0
votes
1 answer
Unity - Scriptable object automation
I have a requirement to automate the creation of X amount of scriptable objects from a CSV file, in the image below is an example of a manually completed one, the minimum amount of automation I need for this is the name/description/stat…

Luke
- 25
- 5
0
votes
1 answer
Unity make ScriptableObject on a build
I'm new to scriptable objects, but I've seen a lot of tutorials using them for an inventory system and recipes. My question is if it is possible for a future player of my game to create new "recipes" in the final build that will be saved as…

DerPenz
- 1
- 2
0
votes
1 answer
Unity Scriptable Object does not retain his values after the editor is closed
I have the following scriptable object:
[CreateAssetMenu(fileName = "Assets/Gladio Games/Resources/Levels/LEVLE_TMP", menuName = "Utils/Crossword/Generate Empty Level", order = 100)]
public class Level : ScriptableObject
{
public char[,] Table {…

Max_Power89
- 1,710
- 1
- 21
- 38
0
votes
1 answer
Changes made to Scriptable Object are lost even after calling EditorUtility.SetDirty()
I have a script called HandSkeleton for which I wrote a custom editor. HandSkeleton has a field of type HandSkeletonData which is a ScriptableObject. I wrote a custome inspector which can save some values from HandSkeleton to the HandSkeletonData…

Wojtek Wencel
- 2,257
- 6
- 31
- 65
0
votes
2 answers
Why cant I drag and drop a Sprite in a Scriptable Objects inspector?
So I have a scriptable object that holds a public Image variable. And I want to drag an image to the inspector, but I'm not able to get it to work. I have changed the Texture Type to Sprite (2D and UI). I have tried to find people with similar…

Izze
- 13
- 1
- 1
- 4
0
votes
1 answer
Unity can I instantiate a game object from a scriptable object?
I want each bow to shoot a different arrow that I set in the SO when it is created. I need each bow to shoot the assigned arrow prefab in the SO.
WeaponConfig has [SerializeField] public GameObject projectile; field where I want to be able to swap…

David
- 705
- 1
- 6
- 22