I have an asset and I am trying to programmatically create a new_asset on top of that asset and then assign new_asset to asset so that I can run the same code again and again to create assets on top of one another. But for some reason I can’t assign the new_asset to the asset variable.
NewAsset.translate(0,Asset.getLocalPosition().x + 1, 0); Asset = NewAsset; console.log(Asset.getLocalPosition().x);
My first Asset is at x=0. So the first time the code runs a NewAsset is created at x=1 and the console should print 1 but it prints 0. Every time the code runs a NewAsset keeps getting created at x=1.