# Create new substance in unity

**URL:** https://discourse.kitware.com/t/create-new-substance-in-unity/959
**Category:** Pulse Physiology Engine
**Created:** [January 11, 2023, 11:40pm UTC](https://discourse.kitware.com/t/create-new-substance-in-unity/959 "2023-01-11T23:40:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Marcello\_Vecchio](https://discourse.kitware.com/user_avatar/discourse.kitware.com/marcello_vecchio/32/636_2.png) [@Marcello\_Vecchio](https://discourse.kitware.com/u/Marcello_Vecchio)
#### Post date: [January 11, 2023, 11:40pm UTC](https://discourse.kitware.com/t/create-new-substance-in-unity/959/1 "2023-01-11T23:40:07Z")

</div>

Hello, I’m trying to create a new substance and importing it in unity but I can’t succeed.  
I created the Atropine.json and stored it in Data/substances, but when I try to call it from a script unity crashes.  
What am I doing wrong?  
The method I am using to call it from the script is the following

> SESubstanceBolus bo = new SESubstanceBolus();  
> bo.SetSubstance(“Atropine”);  
> bo.GetConcentration().SetValue(50, MassPerVolumeUnit.mg\_Per\_mL);  
> bo.GetDose().SetValue(1, VolumeUnit.mL);  
> bo.SetAdminRoute(eSubstanceAdministration\_Route.Intravenous);  
> driver.engine.ProcessAction(bo);

All other standard substances work while being called this way, only new .json can’t be opened.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [January 12, 2023, 12:06am UTC](https://discourse.kitware.com/t/create-new-substance-in-unity/959/2 "2023-01-12T00:06:26Z")

</div>

If you are initializing the engine by loading a state file, that new substance needs to be in the state file  
If you are initializing the engine by stabilizing to a patient configuration, that should work

Which are you doing?

---

<div class="post-metadata">

### Author: ![Marcello\_Vecchio](https://discourse.kitware.com/user_avatar/discourse.kitware.com/marcello_vecchio/32/636_2.png) [@Marcello\_Vecchio](https://discourse.kitware.com/u/Marcello_Vecchio)
#### Post date: [January 13, 2023, 11:25pm UTC](https://discourse.kitware.com/t/create-new-substance-in-unity/959/3 "2023-01-13T23:25:41Z")

</div>

I was loading a state file without putting it inside. Thank you
