I created a script, and on opening, it ran in VS-Code.
That’s good. The only problem is, I don’t get code completion, which is strange, I think.
I have the three extensions installed - C/C++; C#; Mono Debug.
Is there something missing for code completion in C#?
I tried to use Visual Studio, as the code editor, so I enabled VS2022, but that doesn’t even start (I checked the Task Manager).
I tried VS2019, which shows up in the Task Manager’s Background Processes, but that’s as far as it gets. I waited a long time for it to start, but it doesn’t.
Now that I think about it, maybe I should start it before opening the script.
I haven’t missed anything important, have I?
I wanted to try out Visual Scripting, but I need a push start.
I selected a Vector 3 node in order to declare a variable, but I don’t know what to do.
How do I declare a variable, like this, with Visual Scripting?
For Flax, I have the .NET Framework 4.8, C#, C/C++, and Mono Debugger installed and autocompletion works for me. I have a lot of software, so I don’t remember if any of these are required for Flax specifically, but maybe this will help you out. The reason why I don’t use VSCode is because Flax uses the .NET Framework 4.5.1, which is not available to download anymore. So, any time I modified the scripts in Flax, I’d have to go into the Game.csproj file and change the .NET target from 3.5 to 4.8 manually to get autocompletion working. Doing that after each time I crate, rename, move, delete, or otherwise modify a script in Flax Engine gives me autocompletion:
That sounds like a bug that you should file, if it happens consistently. I’ve never experienced that issue personally with any Visual Studio version. Although, Visual Studio will at first open a dialogue window asking to convert the NET target from .NET Framework 4.5.1 to 4.8. I let it do that, and it opens for me.
Variables in Visual Script are called Parameters. Create a new parameter from the side bar and select the type:
I don’t have a .csproj in my project’s directory.
Wouldn’t that be created by Visual Studio?
I’ll try it a couple more times, before I do anything else, thanks.
Thanks. That’s helpful.
I’m looking at the manual, but not seeing anywhere, where I can get this kind of help. Is there any docs on these, so that one can know how to use Visual Scripting with more ease?
If you set the code editor to VSCode in the Flax Editor Options, then it should automatically generate the project files for you. If not, you can go to File > Regenerate Script Project Files.
Unfortunately, yeah, Visual Script lacks almost any documentation. I came from UE, so I could translate most of my Blueprint knowledge pretty easily. But for anyone new to Visual Scripting, the Docs aren’t going to be of much help.
Something must be wrong with my system, because no project files are generated, despite following those instructions.
For Visual Studio, does Flax try to run a 32 bit instance of VS.
I’m wondering if that’s why it doesn’t start.
Half an hour after, and Visual Studio doesn’t open.
I’m a quick learner, so once you get me started, I’ll be able to work my way through.
So, how do I declare a variable, like the following? norm = new Vector3();
I’m wondering if Flax has a hard time when multiple versions of Visual Studio are installed? I only have VS2022, and before that I had VS2019 64-bit.
As far as I’m aware, variables are initialized when they are created in Visual Script, similar to Blueprints. So, your initial value will be in the side bar, and it has a default value of Vector3.Zero.
I’ve never used that node before, but it seems to be used when creating objects. Your current node setup would translate to this in C#:
public override void Start()
{
norm = Vector3.Zero;
Object.NewValue<Type>();
}
The white lines are used to declare code flow. Whatever is connected to the current node will be called after the current node has finished executing. The circles are used to transfer data, such as a String:
I also have 4 different VS version , but if your set it to “Default” it will use the windows extension associate, so it will act just like if you double click it in explorer , that works for me