Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[CreateAssetMenu] problem

Discussion in '2D' started by Rockysek018, Jan 6, 2020.

  1. Rockysek018

    Rockysek018

    Joined:
    Jan 11, 2019
    Posts:
    13
    Hey guys,
    I don't know if I should post it here but I found a problem and I don't know what to do with it.
    Here is the code:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. [CreateAssetMenu(menuName = "theFrefly/newAnswer")]
    6.  
    7. public class Answer : ScriptableObjects
    8. {
    9.     [TextArea]
    10.     public string description;
    11.     public string answerName;
    12. }
    13.  
    The problem:
    I just don't see the ,,theFrefly" selection in Create tab.
    Anyone know what to do with this?
     
  2. Rockysek018

    Rockysek018

    Joined:
    Jan 11, 2019
    Posts:
    13
    Also just tried this:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. [CreateAssetMenu(fileName = "Answer", menuName = "Answers/NewAnswer", order = 100)]
    6. public class Answer : ScriptableObject
    7.  
    8. {
    9.     [TextArea]
    10.     private string description;
    11.     private string answerName;
    12.  
    13. }
    14.  
    Still the same problem.
     
  3. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    Try either:
    Code (CSharp):
    1. [CreateAssetMenu]
    2. public class Answer : ScriptableObjects
    or
    Code (CSharp):
    1. [MenuItem("Assets/Create/Answer")]
    2. public class Answer : ScriptableObjects
     
    Last edited: Jan 6, 2020
  4. Rockysek018

    Rockysek018

    Joined:
    Jan 11, 2019
    Posts:
    13
    Thank you, thank you, thank you!! You are amazing!
    Have a nice day!
     
  5. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    Night actually. ;)

    And have a good... time!