Scripts aren't always compiled

Hello, I’m new to flax but experienced many game engines like Unity, Godot etc. I’ve also made many private projects. Now I’m going to do a big commercial game project where I should discuss a problem happening with me from my start in flax engine.
When I finish coding a C# script (No idea for C++) in VS, I go back to Flax and I find my Script not working. It works like how it was before the last change, but not like expectation of the last change. Though it shows compiled on progress bar, it doesn’t works until I move the script to another folder and move it back to where it was and reattach the script to object. Or delete Script and create new one works too. But sometimes switching from VS to Flax editor doesn’t compiles new codes though it shows like it did in the progress bar. Recompiling manually doesn’t works too from the menu strip at top of Flax editor.
Also all the other script changes doesn’t applies by the compile, I’ve play-tested it a lot.
I feel annoying to change script directories to make a script work. I want speed development, just go to Flax from VS and complete compile
Not much sure if I’m doing something wrong or this is a flax engine bug. Please help me if you can give me a solution. Any suggestions are thanked!
(The problem is random)

Try installing the flax extension for visual studio

1 Like

Hey, sorry, I’ve did it. I’ve closed VS after downloading Flax extension. then it’s installed and I’ve tried many changes.
I’ve tried doing some things. Here’s one-
I’ve just tried adding a new public variable “public bool test’”
And here in the script properties, test Boolean property is not visible.

By the way, I think Flax extension may help me in few cases. Thanks for including flax extension, it maybe important in some cases.
I’ll trying to figure it out the next day if I don’t get a helpful solution. Help me anybody :sob: if there are!

Welcome to the Flax Forums!

Hmm. It sounds like the project has some corrupt files. Did you try making a new project and moving all your assets and scripts to the new project? It’s fixed similar issues for me before.

Edit: I’ve had issues with game modules not being loaded as well. Usually that problem arises for me when I make an edit to a script and save it while it’s still compiling in flax Engine.

1 Like

Hm… you maybe right, I do save scripts sometimes during compilation (Specially in Unity)! And yes, looks like there were errors that my eye left :sweat_smile: . I’ll try creating new project and move to it and I will tell the result to you guys in Forum.
Luckily it won’t take much of a time since it’s a pretty small project!
Thanks for the method! I’ll try it and tell the result.

Result is you’re right, another project creation solved the problem. I don’t know will I change a script during compilation without of focus. I wish to have something that will be able to fix engine errors like this on Flax engine, like Unity has.
But I don’t mean I’ll switch to Unity, I don’t want to use Unity engine for lots of reasons. If everything is very right, I’m going to keep making games in Flax. And I can see this rare engine has lots of tools that can’t make my mind switch to other engines right now.

I hope problem will not be going to occur again. If this happens after lots of hardworks (Can happen by losing focus), I’m going to be very mad.
But thanks all to help me!

(I’m not sure if you’re Flax Engine’s developer, but if you’re, so I want to say, from so many rare engines I’ve used so far, Flax is the best, I want to say more better than Unity in most cases. So thanks to take part to make this king of good engine available free in 25000K price tag. I’m agreed with the licensing. It’s powerful, and I can use it! If you guys work more hard, it’s going to catch lots of attention! I love the engine! Thanks Flax Engine …)

I just avoid saving while script are compiling.

According to this forum post, deleting Game.gen.cs and restarting the Flax Editor might be another way to fix this issue.