playMaker

Author Topic: Unity 5 aspect ratio problems  (Read 4177 times)

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Unity 5 aspect ratio problems
« on: April 04, 2015, 08:22:48 AM »
Hi,

Since I updated to Unity 5 and playmaker I have a problem that my aspect ratio functions doesn't work properly.
I use "Get screen size ratio" and save that value. I then convert that value to a string and save it as a global variable.
Then I use a string switch and check what the global string value is and then I set orthographic size of the camera depending on that string value.

I use that in all scenes when they start to set things right depending on what device the game is played on and I use it when I zoom in and out inside the scenes. It has always worked before Unity 5 and latest updating.

Now, when I play it on the computer, It works without any problems. But, when I try and build it for my iPad, it doesn't work anymore. Going nuts to try to solve this. Any suggestions?

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: Unity 5 aspect ratio problems
« Reply #1 on: April 06, 2015, 02:58:21 PM »
Any suggestion on how to even debug this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Unity 5 aspect ratio problems
« Reply #2 on: April 07, 2015, 12:21:33 AM »
Hi,

 What is the returned value on ipad, vs the expected one?

Bye,

 jean

Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: Unity 5 aspect ratio problems
« Reply #3 on: April 07, 2015, 09:50:46 AM »
I have now checked a bit further and see that the value that the iPad returns is still the same. I have also checked to see that the FSM actually gets to the state I want it to go to, in this case the state called 4:3. So what I think might be causing the problem is the set property/orthographic size. See attached image.

It works when I press play in Unity but not on the device. Any ideas?


Slater

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: Unity 5 aspect ratio problems
« Reply #4 on: April 07, 2015, 10:20:44 AM »
I now found an action I haven't seen before (Set camera ortho size) and tried to import that from Ecosystem, but it got me parse error. Then I found it here on the forums so I imported that instead without parse error. Then I tried to use that instead to set the ortho size and it works. So it looks like the old way using Set Property/Camera/Orthographic Size doesn't work. Pain to have to rework all in our apps for this, but I don't know what else to do.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Unity 5 aspect ratio problems
« Reply #5 on: June 23, 2015, 04:59:47 AM »
Hi,

 Actually, all of this should be managed by the UI system directly. you are using the new UI yes? then you can set in the Canvas Scaler Component ( on the canvas GO) mode to "Scale with screen size" and put the match to 0.5.

 this is how I solve screen ratios, and it works very well, play around with this.

else, the ortho size action works, maybe you need to try and download it again from the eco ( you may have had a glitch and the code wasn't downloaded properly).

 Bye,

 Jean