Attaching Scripts to Assets
Hi Creators!
I am using Desktop Editor and Typescript.
I am trying to spawn enemies, when the enemies spawn they will move around and look for the player, enemies can also get destroyed by bullets. The enemy is a 3D model in my assets. I can spawn the 3D model. I can also make the enemy move IF the enemy is already in the hierarchy and I attached a move/collision scripts I created.
What I can't figure out is how do I attach the move script to the ENEMY ASSET (Similar to attaching scripts to a prefab in Unity). So that when the enemy is spawned, it starts moving? There is no script option unless I drag the enemy asset to the hierarchy, but then that means I'm editing a copy and not the original asset.
Thanks!
If you want the script on the asset at spawn time. You will need to either create a copy of the asset with the script already attached or update the current asset after attaching the script. Let me see if I can get some screenshots.
EDIT: If you right click on the asset, click on Edit Template Definition then you should be able to add the script and save the change.