Search Unity

Feature Request Required/Default Object Variables

Discussion in 'Visual Scripting' started by BoxxyPrime, Jun 13, 2021.

  1. BoxxyPrime

    BoxxyPrime

    Joined:
    Jul 2, 2014
    Posts:
    10
    Unless I've missed it, there doesn't seem to be a way to set "required" variables for a graph. Or, variables that are required to be set in the variables component for a graph to work that are auto-added on new instances of the graph.

    An example of this would be making a macro script machine, setting your object variables names/type/value, and building your graph. And then using this macro on another object, but when you add the graph, the variables set is empty - requiring you to re-add your object variables, which is a moderately complicated graph, can be taxing. You can create a preset of the variables, or copy/paste the values from one object to another - but it seems logical to all have this done for you, saving time.

    Proposed change: When adding an object variable to a graph on the blackboard, give an option to also set the variable to be required or auto-added anytime this graph is added to an object - with a default value/type supplied.
     
    Hikiko66 and PanthenEye like this.
  2. codemonkeynorth

    codemonkeynorth

    Joined:
    Dec 5, 2017
    Posts:
    13
  3. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,079
    What if the object has two or more graphs that set a variable with the same name but different types and different default values? Or even the same type, but different values?