Heya, according to this thread, the easiest way to wait for a coroutine in Bolt / Visual Scripting is a custom Unit. This itself works fine, however, I'd like for a variable I'm passing into the custom Unit to be pre-filled, just like the default behaviour. Here's the code from the custom Unit in the screenshot: Code (CSharp): public class TestNullMeansSelfNode : Unit { [NullMeansSelf] public ValueInput InteractableInput; protected override void Definition() { InteractableInput = ValueInput<GameObject>("NullMeansSelfTest", null); } } I'm trying to use the NullMeansSelf Attribute to get this behaviour in my custom Unit, but it seems to either not work outside of the Bolt Assembly or there is additional setup required that I don't know about. Is there any documentation about this Attribute? I could not find any. I found the Attribute when Looking at the Definition of the "On Collision Enter" Node that comes with Bolt and it seems to use this Attribute: How do I get an Input Pre-Filled in custom Units? Any help would be lovely! ❤️
Not much to add, but seems like an expected behaviour for some units according to the documentation: https://docs.unity3d.com/2019.3/Documentation/Manual/bolt-self.html Despite of that, it would be much cleaner to use the attribute instead of the This/Self unit. You have my vote on this feature
The key in the ValueInput<T>(string key, T default) method must be the same as the ValueInput variable name, else it won't work (you will have None⦾ instead of This⦾) You might also want to add the .NullMeansSelf() method in your Definition() method (almost all the VisualScripting base unit use it with the NullMeansSelf attribute). Code (CSharp): public class TestUnit : Unit { [DoNotSerialize] [NullMeansSelf] public ValueInput TestBoth { get; protected set; } [DoNotSerialize] [NullMeansSelf] public ValueInput TestAttributeOnly { get; protected set; } [DoNotSerialize] public ValueInput TestWithoutAttribute { get; protected set; } [DoNotSerialize] [NullMeansSelf] public ValueInput TestBug { get; protected set; } protected override void Definition() { TestBoth = ValueInput<Transform>(nameof(TestBoth), null).NullMeansSelf(); // Works TestAttributeOnly = ValueInput<Transform>(nameof(TestAttributeOnly), null); // Works TestWithoutAttribute = ValueInput<Transform>(nameof(TestWithoutAttribute), null).NullMeansSelf(); // Does not work TestBug = ValueInput<Transform>("TestBugErr", null).NullMeansSelf(); // Does not work } }