# Change Target of Command Instruments In Code?

**URL:** <https://qa.fmod.com/t/change-target-of-command-instruments-in-code/19004>\
**Category:** Unity\
**Created:** [July 15, 2022, 6:38pm UTC](https://qa.fmod.com/t/change-target-of-command-instruments-in-code/19004 "2022-07-15T18:38:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ritualstudios](https://avatars.discourse-cdn.com/v4/letter/r/779978/32.png) [@ritualstudios](https://qa.fmod.com/u/ritualstudios)\
**Post date:** [July 15, 2022, 6:38pm UTC](https://qa.fmod.com/t/change-target-of-command-instruments-in-code/19004/1 "2022-07-15T18:38:39Z")

</div>

Is there anyway to change the target event of a command instrument via code in Unity? We want to have command instruments on a timeline and be able to swap what events it is triggering depending on what is going on in the game.

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/adc40bab9003b1c793da28912f684e547140bff4.png)

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [July 18, 2022, 5:58am UTC](https://qa.fmod.com/t/change-target-of-command-instruments-in-code/19004/2 "2022-07-18T05:58:01Z")

</div>

Hi,

Unfortunately, we don’t support changing the `target` of a `Command Instrument` through code. However, an alternative that might give you the functionality you are looking for: `Nested Events`, explained under [Organizing the Project: Nested Events](https://qa.fmod.com/t/change-target-of-command-instruments-in-code/19004), will let you trigger different `events` depending on [Parameters](https://www.fmod.com/docs/2.02/studio/parameters.html) that are can be controlled by the conditions of your game.

Hope this helps!
