playMaker

Author Topic: SetProperty not working on iOS[SOLVED]  (Read 6530 times)

joel.carlson

  • Junior Playmaker
  • **
  • Posts: 66
    • Salvation's Story
SetProperty not working on iOS[SOLVED]
« 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
« Last Edit: August 01, 2014, 05:29:52 AM by jeanfabre »
Check out Noah's Elephant in the Room, Bible ABCs for Kids, Bible Coloring for Kids, and Noah's Bunny Problem at
Salvations Story

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: SetProperty not working on iOS
« Reply #1 on: July 24, 2014, 06:32:30 AM »
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.
Game Designer, CEO, Artist
http://2ndStudio.com

joel.carlson

  • Junior Playmaker
  • **
  • Posts: 66
    • Salvation's Story
Re: SetProperty not working on iOS
« Reply #2 on: July 24, 2014, 12:17:24 PM »
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
Check out Noah's Elephant in the Room, Bible ABCs for Kids, Bible Coloring for Kids, and Noah's Bunny Problem at
Salvations Story

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: SetProperty not working on iOS
« Reply #3 on: July 25, 2014, 01:32:18 PM »
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?
Game Designer, CEO, Artist
http://2ndStudio.com

joel.carlson

  • Junior Playmaker
  • **
  • Posts: 66
    • Salvation's Story
Re: SetProperty not working on iOS
« Reply #4 on: July 25, 2014, 02:34:06 PM »
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.

Check out Noah's Elephant in the Room, Bible ABCs for Kids, Bible Coloring for Kids, and Noah's Bunny Problem at
Salvations Story

joel.carlson

  • Junior Playmaker
  • **
  • Posts: 66
    • Salvation's Story
Re: SetProperty not working on iOS
« Reply #5 on: July 25, 2014, 06:37:43 PM »
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!
Check out Noah's Elephant in the Room, Bible ABCs for Kids, Bible Coloring for Kids, and Noah's Bunny Problem at
Salvations Story

DennisJensen

  • Full Member
  • ***
  • Posts: 104
Re: SetProperty not working on iOS
« Reply #6 on: July 26, 2014, 09:04:10 AM »
I dragged in the component rather than using the whole object, maybe that's why it didn't work? because that works for me.
Game Designer, CEO, Artist
http://2ndStudio.com

joel.carlson

  • Junior Playmaker
  • **
  • Posts: 66
    • Salvation's Story
Re: SetProperty not working on iOS
« Reply #7 on: July 26, 2014, 04:57:49 PM »
Hmmmm... perhaps. I'll try that out the next time I use SetProperty! Thanks for the input!
Check out Noah's Elephant in the Room, Bible ABCs for Kids, Bible Coloring for Kids, and Noah's Bunny Problem at
Salvations Story

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: SetProperty not working on iOS
« Reply #8 on: July 29, 2014, 09:18:49 AM »
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

joel.carlson

  • Junior Playmaker
  • **
  • Posts: 66
    • Salvation's Story
Re: SetProperty not working on iOS
« Reply #9 on: July 30, 2014, 07:38:26 PM »
Thanks, Jean. That's the method I went with, and it turned out well!
Check out Noah's Elephant in the Room, Bible ABCs for Kids, Bible Coloring for Kids, and Noah's Bunny Problem at
Salvations Story