Playmaker Forum
PlayMaker Help & Tips => iOS Help => Topic started by: joel.carlson on July 23, 2014, 08:07:07 PM
-
I've been trying to get different aspect ratios to work in my game. In Unity everything works great; no matter what aspect ratio I choose, the camera adjusts its size, and it looks great. However, when I make an iOS build nothing happens!
I've been completely stumped on this. I've tried 2 different methods, one of my own creation and one that's worked for my friend. Both have similar results! They work in Unity, but not in iOS. The main culprit I'm finding is the 'SetProperty' action. Both FSMs I've tried use it.
Is there any secret to this? Or a workaround for aspect ratio switching? I've tried changing a few of the optimizations, but still the problem persists.
Thanks so much for your help!
Joel
-
We do the same thing in our game on iOS and it works.
I define the aspect ratio this way:
Get screen width (width_float)
Get screen height (height_float)
Set float1 variable to width_float
Divide float1 with height_float
This gives me a value,
So I compare float1 if it's equal to 1.3333 if it is, the device has a 4:3 ratio,
If the value is 1.5 it has a 16:10ish ratio
for 16:9 I'm not sure, but I it must be somewhere inbetween.
I hope it helps.
-
Thanks for the response. That's exactly how I have my aspect ratio fsm set up, but then when I take it to the State which uses 'SetProperty' to change the size of the orthographic camera, nothing happens in iOS. However, in Unity it works fine. :P
-
Hmm Wierd because setProperty works for us. We change the size as well. It must be the way you set it up, maybe if you take a screenshot it can help?
-
Thanks for trying to help with this! This is pretty much the last thing I need to get fixed before I submit the build to Apple! I'm quite anxious! :)
Here are some screenshots. Again, it all works great in Unity, but not on iOS.
-
Well, I did find a workaround for this. I downloaded the 'Set Camera Ortho Size' action for changing the camera ortho size. I also used 'Set Position' for changing the coordinates of the camera.
I'm still very curious as to why 'Set Property' isn't working. It's an action I'll definitely be using over and over again!
-
I dragged in the component rather than using the whole object, maybe that's why it didn't work? because that works for me.
-
Hmmmm... perhaps. I'll try that out the next time I use SetProperty! Thanks for the input!
-
Hi,
OrthoSize : I made an action for this ( on the ecosystem), so you can replace that.
for the position, I would instead use the regular "set position" and get the camera pos, change the Y and then set the position, this way you remove any reflections and you are good to submit.
I got this as well, and the best way to handle this is to not use "set/get property in these cases". If you encounter a property you can't access using regular actions, let me know, and I'll provide a custom actions for this.
Bye,
Jean
-
Thanks, Jean. That's the method I went with, and it turned out well!