How to add muzzle flash animation?

siitako

Well-Known Member
Oct 15, 2021
15
29
115
I am making an original gun with the official terratech modding tool. Is there a way to add a muzzle flash sprite animation to my gun? I created an original sprite image, added it to the "Muzzle Flash Anime" prefab, and set the material to Splites-Default. They were drawn fine on the unity preview screen, but when I checked the in-game behavior with local export, I saw pink sprites on the muzzle that appeared when the proper materials were not set.
 

Darvin

TerraTech Arms Dealer
Jun 13, 2020
405
400
470
[REDACTED]
www.youtube.com
Is there a way to add a muzzle flash sprite animation to my gun?
Nope. I don't think the official modding tool was designed with muzzle flashes and smoke in mind. That being said, if you managed to get the mesh up and running, that's like halfway there, i don't think anybody (me included) ever managed to make muzzle flashes with official modding tool, if you can describe your process in detail, perhaps i can be of some assistance. But my advice, start making mods with nuterra block injector, it will give you more freedom and near unlimited possibilities
 
Last edited:

SadKen

PAYLOAD STUDIOS
Oct 10, 2017
121
321
475
@siitako Yes - you can add a muzzleflash to weapons in the official modding tool but it will be the default effect used by most other weapons in the game. Unfortunately in the current version you're not able to add your own texture.
 

siitako

Well-Known Member
Oct 15, 2021
15
29
115
@siitako Yes - you can add a muzzleflash to weapons in the official modding tool but it will be the default effect used by most other weapons in the game. Unfortunately in the current version you're not able to add your own texture.
What settings should I make to add the default effects used in the game? Should I edit the JSON file or the prefab?
 

SadKen

PAYLOAD STUDIOS
Oct 10, 2017
121
321
475
If you follow the Guns section of the Official Modding Guide:


Move the _muzzleFlash gameobject in your prefab to the end of the barrel, or wherever you'd like the effect to appear.
 

siitako

Well-Known Member
Oct 15, 2021
15
29
115
Unfortunately, the "_muzzleFlash" object doesn't seem to work properly. When I add a mesh or sprite component, they appear in the object's location, but nothing is displayed without the component. (Since "_light" is valid, only the point light is drawn at the position of the "_muzzleFlash" object.) Similarly, the "_smoke" object has no effect.
 

SadKen

PAYLOAD STUDIOS
Oct 10, 2017
121
321
475
@siitako You're right - it doesn't appear to be working correctly in the current version. Thanks, I've logged a bug report.
 
  • Like
Reactions: siitako