EtG Modding Guide
  • ETG Modding Guide
  • Getting started
    • Modding EtG: Installing Mods
    • Modding EtG: Creating a Mod
    • Uploading a Mod
    • Useful Tools
      • Using IlSpy
  • Making An Item
    • Creating A Passive
    • Creating An Active
    • Creating An Ammolet
    • Creating A Guon
    • Synergies
  • Making a Gun
    • Creating A Gun
      • Setting Up Gun Sprite Folders
      • Creating Gun Jsons/Jtk2ds
        • Pixel Measurement Conversions
    • Setting Up Projectiles
      • Adding Components To A Projectile
      • Projectile HitEffects (Visual Effects)
      • Adding status effects to a projectile
    • Continuous Fire Animations
    • Gun Ammo Types
  • Custom Characters
    • Creating A Standalone Custom Character
  • Making a Floor
    • Introduction
    • Setup
    • Making The Dungeon
    • Tileset
    • Rooms
    • Making the flow
    • Making the Entrance
    • All Files
  • Text, Text Boxes, Etc
    • Textboxes
    • Text Formatting
  • Sounds
    • Using Custom Sounds
    • Customising Gun Sounds
    • Basegame Sound List
    • wwise Sound Dump
  • Misc
    • Making Asset bundles
    • Assetbundles: How-To
    • How to create a hook
    • Creating A Command
    • Subscribing Methods to Actions
    • Reversing Player Controls
    • Undodgeable Projectiles
    • Creating An Enemy
  • Shaders
    • Creating Shaders
  • All things Spriting
    • Important Sprite Creation Information.
    • Importing a Sprite To Visual Studios
  • Monobehaviour Documentation
    • BounceProjModifier
    • PierceProjModifier
    • KeyProjModifier
    • CompanionFollowPlayerBehaviour
  • Various Lists of IDs, Sounds, Etc.
    • List of Item and Gun IDs
    • Enemy Guids
    • List of Base Game Synergies
    • dfSpriteList
    • All Custom Ammo Types
    • Gun .Json Dump
  • OFF TOPIC MEMES
    • Modders Anthem
Powered by GitBook
On this page
  • Difficulty: 1/10
  • Basic Variables
  • Copying From Existing Guns

Was this helpful?

  1. Making a Gun
  2. Setting Up Projectiles

Projectile HitEffects (Visual Effects)

A quick guide for setting up projectile HitEffects.

PreviousAdding Components To A ProjectileNextAdding status effects to a projectile

Last updated 9 months ago

Was this helpful?

Difficulty: 1/10

A projectile's HitEffects are the visual effects that play upon a projectile impacting an object or wall. They can be changed or set as desired. The easiest way to set up HitEffects is to copy the vfx object from an existing gun in the vanilla game, though it is possible to assign your own custom vfx object if you know how to make one.

Basic Variables

A projectile's hitEffects can be accessed easily via projectile.hitEffects. Via this method, you can adjust the following variables, and more;

projectile.hitEffects.alwaysUseMidair
projectile.hitEffects.midairInheritsFlip
projectile.hitEffects.midairInheritsRotation

alwaysUseMidair determines whether or not a projectile will attempt to use its mid-air effect upon impacting anything. Usually, the midair effect will only play if the projectile reaches the end of its range mid-flight, however, if this variable is set to true the projectile will always use its mid-air effects.

midairInheritsFlip determines whether the midair vfx will flip along the horizontal axis to match its base projectile. If this is set to true, projectiles fired to the left will have their midair effects flipped to face the left. This is only noticeable on mid-air effects that are notably directional.

midairInheritsRotation determines whether the midair vfx will rotate to match the rotation of its base projectile. If this is set to true, projectiles fired at (for example) a 90-degree angle will have their vfx rotated by 90 degrees. This is only noticeable on mid-air effects that are notably directional.

Copying From Existing Guns

The easiest way to set up a projectile's hitEffects is to copy appropriate effects from an existing vanilla gun. Many guns in vanilla actually do this themselves; The Wind-Up Gun, Void Marshal, and Laser Rifle all use the same hitEffects.

To keep things simple, you may choose to always use the midair effect, as explained in the previous section. This will mean you only have to change a couple of variables to make the effects work.

projectile.hitEffects.overrideMidairDeathVFX = (PickupObjectDatabase.GetById(89) as Gun).DefaultModule.projectiles[0].hitEffects.overrideMidairDeathVFX;

This is an example of copying the midair effects from a base game gun, in this case, the Rogue Special and it's green laser circles. The gun is referenced via its numerical id, in this case, 89. If you want to copy from a different gun's hitEffects, you can change that number to the numerical id of a different gun. A full list of numerical ids can be found .

To copy the other effects of a vanilla gun, you can use similar code;

projectile.hitEffects.tileMapHorizontal = (PickupObjectDatabase.GetById(89) as Gun).DefaultModule.projectiles[0].hitEffects.tileMapHorizontal;
projectile.hitEffects.tileMapVertical = (PickupObjectDatabase.GetById(89) as Gun).DefaultModule.projectiles[0].hitEffects.tileMapVertical;

To see a list of base game effects that guns use, go to this page:

https://enterthegungeon.wiki.gg/wiki/Weapon_Visual_Effects
here