title: Can I instantiate prefabs from an animation?
body: <p>I have this animation where my character loads up their gun then shoots. I wish there was a way of instantiating the bullet in the animation, instead of having to do that outside of the animation (e.g. in code). I can get around this using one of the following:</p>
  <ol>
  <li>Add a bullet spawner to the player, which would expose a boolean flag &quot;isBulletRequested&quot;. In the animation I can turn this flag on towards the end, and then the bullet spawner knows how to spawn the bullet and reset the flag.</li>
  <li>Similar to the above, but more generically--add a &quot;prefab spawner&quot; to the player, which has an exposed filed &quot;spawnCommand&quot;. It would have values like &quot;spawnCommand=Bullet.prefab (0, -1, 1)&quot;, which is asking to instantiate the bullet prefab at the Vector3 position provided.</li>
  </ol>
  <p>Even though the solutions above work fine, I don't like them because it's not a smooth workflow; I'll need to create the animation in blender, then have to modify it in Unity to add the spawn. And every time I modify the animation I have to repopulate the spawn commands.</p>
  <p>Any thoughts on how to handle this better?</p>