rahulng Posted February 17, 2014 Share Posted February 17, 2014 Hey guys,Ive been working on making a level editor in unity and then storing the resultant transform information like scale,position and rotation in a.json file to be read by phaser.while the position and rotation work perfectly well by changing the pivot of the sprites in unity.the scale doesnt seem to work ie the scaling in unity doesnt show the same result in phaser.if anyone has suggestion on how to calibrate it please let me know. Link to comment Share on other sites More sharing options...
rich Posted February 17, 2014 Share Posted February 17, 2014 How far out is it? Do you have some screen shots / stats / comparisons to show us? Link to comment Share on other sites More sharing options...
rahulng Posted February 18, 2014 Author Share Posted February 18, 2014 unity code double turret_scale_x=(turret_reference[index].transform.localScale.x-standardscale)/2; double turret_scale_y=(turret_reference[index].transform.localScale.y-standardscale)/2; if(turret_scale_x<=1) turret_scale_x=1; if(turret_scale_y<=1) turret_scale_y=1; m.AddField("scalex",(float)turret_scale_x); m.AddField("scaley",(float)turret_scale_y); original scale value=6.5changed to:18.65 but wen i use thes same stats in phaserusing the scaleto(12,12,'turret'); it makes the thing HUGE,far bigger than the unity output Link to comment Share on other sites More sharing options...
rich Posted February 18, 2014 Share Posted February 18, 2014 Doesn't Unity work in physics dimensions though? I.e. meters or something, not pixels? Don't you have to translate that to px first, and then apply the resulting scale? Link to comment Share on other sites More sharing options...
rahulng Posted February 19, 2014 Author Share Posted February 19, 2014 If that were true then I dont understand how the position part works well whereas only scale doesnt Link to comment Share on other sites More sharing options...
rich Posted February 19, 2014 Share Posted February 19, 2014 According to their docs: https://docs.unity3d.com/Documentation/ScriptReference/Transform-localScale.html the scale is relative to the parent. So, what's the parents scale? Link to comment Share on other sites More sharing options...
Recommended Posts