How to change the scaling of a enemy on instantiate
I have a asset now when the asset is spawned in the game it's scale is wrong it ALWAYS spawns in as scaling (1,1,1). I put it in a Prefab and the prefab's scaling is (0.2,0.2,0.2) now when the enemy is instantiated, it spawns at (1,1,1) instead of (0.2,0.2,0.2) . I have tried all the solutions that i googled, basically making a var and call it scale and then call the Var. non of them work.
GameObject go = Instantiate( yourPrefab );
go.transform.localScale = new Vector3(0.2f, 0.2f, 0.2f);
try this (:
Thank you I will check it tonight. I found a other solution. i put the Enemy in a empty game object then i change the Empty game objects transform to (0.2,0.2,0.2) then i make the empty game object the Enemy prefab but now i will have to make two separate prefabs: 1 for the enemy at (0.2,0.2,0.2) and one for the boss at (1,1,1) so i will see you solution. $$anonymous$$aybe it works better