Any ideas on why this bike won't spawn properly?
I'll preface this post by saying I've spawned 100's of vehicles in both VB.Net and C#, GTA V originals and addons, but I've never encountered this glitch before.
In the picture, the bike on the right (orange) is spawned as a Saved Vehicle with Menyoo.
The bike just in front of it, same model/mod, was Spawned by Menyoo, Vehicle Spawner, Input model.
The bike in the background, with the see-through components, was spawned by the line of code below. For those questioning the code, VB.Net, I had just run it using the GTA model "Sanchez" and it spawned as expected. Substituting the string for 160s2020 (same used to spawn with Menyoo) gave unexpected results.
Again, I've spawned addons through script more times than i can remember.
WTH is happening? And, Nope, this is not a lame attempt at April's Fool jokes.
Vehicle1 = World.CreateVehicle("160s2020", Game.Player.Character.Position + (Game.Player.Character.ForwardVector * 2)))
Here is the same code used to spawn another addon model (both models are addons, not replacements). Only change was the model name as a string. Model spawned as expected without the transparency bug/glitch/whatever. I can add that it doesn't matter if the script is compiled as a .dll or simply dumped into the scripts folder with a .vb extension. The bike will just not spawn even on a restart of GTA V - i.e. not a one-time fluke.
Does the vehicle have any mods? Try changing the mods in a trainer to see if there is one where the bike is invisible. If there is, then in your script you will have to set the mod.
@Jitnaught Thank you once more for your help. Mystery solved although it wasn't very intuitive. Now I know.
I found the issue with Menyoo as you suggested. I then saved two files: the bike with the issue and without the issue. Finally I compared the 2 xml files and found the first mod tag and parameter set to 0 in one file, and the other set to 1.
Then I added 2 lines of code (this was new to me, had to research the function)
Vehicle4.SetMod(VehicleMod.Spoilers, 0, 1)
@JohnFromGWN In retrospect, don't understand why the author would create a spoiler value (and ofc this isn't a spoiler) that would remove most of the frame. The default, and only value, should be to have a frame or am i missing something?