Not a Bug

super unit default values not propagated

SamB 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 1

Steps to create problem.

Create a flow graph with an input and then use it somewhere in the program as a super unit. 

Go back to the super unit graph, and to the input, add a new Value Input. (new input is propagated the super unit instance).

Check Has Default Value (which defaults to 0) (again new input is propagated to the super unit instance with the default value of 0)

But change that default value in the graph and that change is not propagated to the super unit instance.  It remains 0.  However, if you change the default value, then uncheck the Has Default Value box, then recheck the box, the value you set it to remains and that value is then propagated to the super unit instance.

Bolt Version:
Unity Version:
2019.2.14f1 Personal
Scripting Backend:
.NET Version (API Compatibility Level):
.NET Standard 2.0

The port values are never given a chance to be set up.  That's the point I'm making.  Once you click 'has default value' the zero is sent on to the instance, you can't preset the value before you check that box.  So when you do set that default value, it doesn't get sent to the instances as you might expect.

I understand the need to keep the values you might have changed in the instance, it just seems, if not a bug strictly speaking, then at least behavior that is unclear, to know that you have to uncheck and check a box to get your default value to pass through if you already have an instance of the super unit in your program.  I'm creating a new value input that didn't exist on my instantiated unit, why would I want to preserve the default default value of zero?

To be fair, this is a very particular situation, and I can't think of a way to make it clear to the user that their default value won't change on existing units unless they uncheck and recheck.  Anyway.  Thanks for your response.

Satisfaction mark by SamB 2 years ago
Not a Bug

Hi Sam,

Thanks for the report. However, that behaviour is by design. Once the unit is instantiated, its port values are copied from the default values you set up in the graph. We don't change them anymore, because you might want to keep that value as you go on. 

If you uncheck and recheck the default value checkbox, it causes the default value data to be lost on the super unit instances, then recreated, which is indeed why the value updates at this point.