Unity Setup Guide — Converting Placeholders into Working Prefabs & Wiring VFX
(Tanjiro & Rengoku)
1) Import the package files into your Unity project (Assets/...).
- Copy the 'Assets' folder from the ZIP into your Unity project's Assets/
directory or import via Unity Editor.
2) Generate VFX prefabs
- In Unity Editor, open: Tools → DemonSlayer → Build VFX Presets
- Click 'Generate Tanjiro & Rengoku VFX'
- This will create prefabs in Assets/VFX/Prefabs: TanjiroSlash, RengokuSlash,
ImpactSpark, EnrageFlames.
3) Replace placeholder player capsule with a humanoid model
- Import your humanoid FBX (Mixamo recommended).
- Create a Prefab named 'Player' and add these components:
- Animator (assign your Player Animator Controller)
- CharacterController
- PlayerController (script)
- CombatSystem (script)
- Stamina (script)
- BlockingSystem (script)
- Health (script)
- TouchInput (attach your VirtualJoystick in HUD)
- Set Player tag = 'Player'
4) Setup Player Animator
- Add parameters: Speed (float), Combo (int), Attack (trigger), Block (bool),
Parry (trigger), ParrySuccess (trigger), Stagger (trigger), Dash (trigger), Hurt
(trigger), Die (trigger)
- Build states: Idle/Walk/Run (blend on Speed), Attack1->Attack2->Attack3 (use
Combo int), Block, Parry, ParrySuccess, Stagger, Die
- Add animation events on attack frames to call 'ResolveAttackHit' or verify
CombatSystem timings (use CombatSystem's timing or call a public method via
animation event to apply damage).
5) Create Boss prefab
- Replace boss capsule with a boss model FBX.
- Add: NavMeshAgent, Animator (Boss controller), BossAI, Health
- Assign the 'player' reference on BossAI to your Player object.
- Ensure NavMesh is baked (Window → AI → Navigation → Bake) to allow
NavMeshAgent movement.
6) Wire VFX to attacks & parry
- For player attack animations: add an Animation Event at the hit frame that
instantiates the appropriate VFX prefab:
- Example: For a water-breathing slash, instantiate
'Assets/VFX/Prefabs/[Link]' at the weapon's tip transform.
- For a fiery slash, use 'Assets/VFX/Prefabs/[Link]'.
- For impact frames, instantiate 'ImpactSpark' at contact point.
- For Boss enrage transition, instantiate 'EnrageFlames' as a child of the boss
and enable/disable the GameObject on phase change.
7) Manual style toggle (Inspector)
- In your Player prefab, add a public Transform 'weaponTip' where VFX spawn.
- In the attack animation events or CombatSystem, reference a public GameObject
field 'slashVFXPrefab' (assign either TanjiroSlash or RengokuSlash in Inspector).
- To switch styles, change the assigned prefab in the Player prefab's Inspector
before play.
8) HUD wiring
- Create Canvas (Screen Space - Overlay).
- Add VirtualJoystick prefab and hook up to TouchInput component.
- Create Buttons: BtnAttack, BtnDash, BtnBlock, BtnParry. Hook
OnClick/OnPointerDown events as follows:
- [Link] -> [Link]()
- [Link] -> [Link]()
- [Link] -> [Link](); OnPointerUp ->
[Link]();
- [Link] -> [Link]()
- Add Sliders for Stamina/Health and attach to PlayerUI script; assign Player
reference.
9) Build & Test on Android
- Ensure Android Build Support installed (Unity Hub).
- File -> Build Settings -> Android -> Switch Platform.
- Add scene (Assets/Scenes/[Link]) to build.
- Build & Run to device.
10) Tips & Troubleshooting
- If particle prefabs appear black, enable URP's bloom and ensure the Particle
material uses an additive shader.
- Tweak particle start sizes and lifetimes to taste; the editor script creates
solid starting points.
- For better mobile performance: reduce maxParticles, lower emission bursts, and
use smaller texture atlases for particle sprites.
If you want, I can also:
- Provide an animation-event helper script that instantiates VFX at weapon tip
with pooling (recommended for mobile).
- Create the pooling system and hook it automatically to the CombatSystem and
BossAI for efficient VFX spawning.