Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity 4.3 Tips Workarounds

Discussion in 'General Discussion' started by atmuc, Nov 12, 2013.

  1. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    to maximize a view press shift+space instead of space. if you don't like this change you can change it using preferences/keys.

    on 2d mode when you click E to move you cannot see axis arrows. to see it click 2D button on the view use arrows on 3D mode (orth/back) and click 2D again to continue with 2D mode.

    do not forget to change meta files to visible if you use source control.

    on mavericks after you change a scene, if you crash when you debug and try to see locals; open your scene. close and reopen unity and try debug. if you open another scene after you opened your project unity crashes.

    Keep both 4.2 and 4.3. Be sure that all assets you use is compatible with 4.3.
     
    Last edited: Nov 12, 2013
  2. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    to make your 2d pixel perfect;

    Use Ortho Camera With Size = ((Your Target Height) / 2 ) / Pixel To Units

    For example if your screen size is 1024x768 and sprite Pixel To Units = 100 (default).
    camera size = ( ( 768 / 2 ) / 100 ) = 3,84
     
  3. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    if you use polygon 2d collider you can edit your collider with shift + click.
     
  4. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    if you want to pack your sprites be sure they all have the same type. you cannot pack images having alpha channel and not having alpha channels.
     
  5. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    if you use physics, while playing on editor be sure you did not select any game object. it cause glitch on game view.
     
  6. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,038
    Thanks for these tips! I haven't even downloaded the update yet and already I know you've saved me some hassle!
     
  7. icreate

    icreate

    Joined:
    Jul 13, 2012
    Posts:
    25
    Thank you for the great tips.

    Speaking of sprite packing, can that be used for textures on materials on 3d objects. I am not sure if I am asking this the right way, but I hope you get what I mean.

    With regard to keeping both versions of unity, 4.3 is backward compatible with 4.2 project file I assume, right?
     
  8. j1mmie

    j1mmie

    Joined:
    Oct 31, 2013
    Posts:
    11
    Unfortunately not. I just tried to open an old 4.2 project and it required that I convert it to 4.3 compatible. I did that, but Unity 4.3 also does not appear to support Unity 4.2 asset bundles. I've been waiting for fixes regarding Unity and OSX Mavericks for some time now, but it looks like I'll have to downgrade my OS to get them :(
     
  9. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,703
    Anyone got any info on the performance of the 2D physics compared to the 3D?
     
  10. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,166
    That's not true. When you're in 2D mode and you click E then you get your Rotation-Gizmo. If you want to have see your axis arrrows just press W (and R for Scaling)
     
  11. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    i haven't tested performance but i can say that; 2D physics is really for 2D games. i spend weeks to make a simple thing for 2D game using 3D physics. with unity 2D physics it is so simple, it is too easy to use, result is much better/suitable.

    don't forget "dont select anyting" tip for editor performance.

    also one tip more; please try interpolation option. it makes it smoother.

    also watch this;

    http://blogs.unity3d.com/2013/11/12/unity-4-3-2d-game-development-overview/

    examine this;

    https://www.assetstore.unity3d.com/#/content/11228
     
  12. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    i just confused shortcut :) i wrote E to move instead W to move. in 2d mode, when selected a sprite, can you see axis after you click W?
     
  13. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    until 4.3f3 they we compatible. with f4 they are not. what asset bundles are not compatible? so far i have no problem except debugging. it is also generally solved with 4.3f3.
     
  14. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    i do not think 2d packer effect 3d. in fact there is no public external packed image. it looks it make it internally and it uses it with sprite renderer. this is what i guess.

    keep 4.2 and 4.3 means. go on using 4.2 with your serious projects until you are sure all assets you are using are compatible with 4.3. so copy your project and test everything with 4.3. if there is problem go on with 4.2.
     
  15. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,166
    Ah, after selecting a Sprite! Well that I didn't try out, I thought you mean the generel behaviour, selecting anything. It works everywhere else then, I guess.
     
  16. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    if you have problem with MonoDevelop project;

    close Unity, close MonoDevelop, delete all files in project root. delete files like *.csproj not folders :) if exist you can delete Temp folder. open unity and test.
     
  17. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    if you have problem with opening a project;

    close unity and monodevelop delete all project root files + Library folder in project root + Temp folder in project root if exist.
     
  18. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,703
    Just was experimenting with 2d physics... in the editor it ran at 60fps but in window build it ran at 30fps and no matter what I couldn't get it to be faster.... maybe some bug to do with `vblank sync off` or some other weird timing thing. With a fresh project it seemed to be okay so maybe I have a setting or something that's doing something weird. But it definitely shouldn't be faster in the editor than in the windows build.

    I'm still a bit disappointed with physics performance overall, it just seems like on modern pc's nowadays you should be able to have thousands of objects bouncing around smoothly. I'm on a fast pc here and at 1500 or so spheres it started falling below 60fps. Why not 15000? I know physics calcs can be complicated and there are tweaks etc but maybe there should be a super simple collision system without all the extra adjustments and stuff that runs much faster for simple cases.
     
  19. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    7,163
    The Unity physx implementation is pretty old, I imagine an updated version would help that.
     
  20. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    do you use mac or pc? fps is the same with me. i think it does not show correctly or there is a limitation like if there is nothing calculate more this fps is enough :) i have mac on game view i see 80 fps i resize this view i show 1200. my mac has 2 video cards. maybe it switches.

    are not movements smooth? have selected any game object?
     
  21. Rocketballs

    Rocketballs

    Joined:
    Sep 13, 2012
    Posts:
    23
    I hope it's ok to ask a quick question here :)

    Is there a way to snap vertices when editing a collider?
    Like snap a collider vertice to a sprite vertice.
    I don't really need this. More like OCD kicking in for not being perfectly aligned ;)
     
  22. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,703
    I'm testing 2D performance. I am moving a bunch of sprites from script. I get the sprites via a gameObject hooked into an exposed variable and then instantiate them and move them around in Update() with a simple loop. I noticed that when I do this with a regular GameObject with a mesh `Quad` representing a sprite (7000 GameObjects) I get 36fps. When I change it to a `Sprite` object by creating a new sprite and using a `sprite texture`, the fps goes up to 48fps (these are Editor frame rates).The draw calls are higher with the sprite for some reason even though they both just use one texture (44 vs 22?). These numbers are with the built-in Unity sprite shader. When I switched to a simple mobile-optimized alpha-blend shader the framerate dropped to 42 which I found surprising, so Unity's shader is quite fast.

    I presume that internally there are some calculations that are possibly simplified when you're dealing with a Sprite rather than with a regular GameObject? I realize it could ignore Z position for example and rotation calculations are probably quicker. I don't know if that explains it but it seems like a nice little boost in terms of per-object overhead.
     
  23. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,254
    The Z position isn't really ignored; you can use it to change the order in which sprites are drawn, or for parallax effects if you use a perspective camera. It is ignored for 2D physics though.

    --Eric
     
  24. imaginaryhuman

    imaginaryhuman

    Joined:
    Mar 21, 2010
    Posts:
    5,703
    I can't figure out why Unity's sprite shader is faster than mine. Mine even has a less going on, ignoring texture scale/offset and doing pretty much everything else the same, and yet Unity's runs faster. I wonder if it ties into some kind of defaults expected by the sprite renderer which makes it process faster or something?
     
  25. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,254
    Are you sure it's the shader?

    --Eric
     
  26. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    Don't use game view stats to compare performance.it is inconsistent. just resize the game window it changes weird.
     
    Last edited: Nov 13, 2013
  27. domx

    domx

    Joined:
    Jul 23, 2013
    Posts:
    6
    Thanks for all the useful tips! I was trying to work out whether introducing pillarboxes/letterboxes is natively supported for 4.3 2d game resolution scaling, but couldn't find it. Any idea if that is the case?
     
  28. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,928
    I'm noticing a HUGE performance drop in windows build. Like terrible. My game runs 40-60 fps in editor, but 9-15 fps in windows build... Works fine in webplayer.. The performance was the same across the editor/windows/web before 4.3.

    Any solutions? Can we confirm this is a bug..?
     
  29. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,050
    Yup, i'm noticing the same thing. Went from 60fps to 15fps.

    Here's another post about the performance issue

    http://forum.unity3d.com/threads/210543-4-3-Standalone-Builds-Really-Poor-Performance
     
    Last edited: Nov 13, 2013
  30. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    if you still have Mavericks debug problem first play unity then attach process on Monodevelop.
     
  31. aureliocalegari

    aureliocalegari

    Joined:
    Dec 26, 2012
    Posts:
    20
    Anyone having problems with GPU profiling metrics after 4.3 update?
     
  32. squared55

    squared55

    Joined:
    Aug 28, 2012
    Posts:
    1,818
    Has anyone else had problems with OC? After re-baking, it both has no effect on performance, and switches off lights it shouldn't.
     
  33. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    911
    Another user and I have had issues with destroying Terrains from within Coroutines (results in a crash). The same code that worked with 4.2 no longer works with 4.3. I started a new thread about this issue here, but I'm not getting much response. Anyone experiencing this crash, or can think of a solution?
     
  34. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,043
    2d physics bounce threshold is fixed 1.0. take care of your velocity. if it is not enough change your pixel per meter value.
     
unityunity