playMaker

Author Topic: Device Roll wrong values  (Read 6662 times)

klvo

  • Playmaker Newbie
  • *
  • Posts: 13
Device Roll wrong values
« on: March 24, 2013, 04:08:08 AM »
Hi there,
I'm working on a project that uses Get Device Roll a simple tilting effect on an iPad2.
It was working great a year ago, but then I stopped working on it, and now I upgraded to Unity4 and started working on it, and I'm getting the wrong values for the roll angle.

The project is setup to work on any landscape orientation, and I've put in place orientation checks to check if the device is in Right or Left orientation at any given moment, including startup.
I also reimported a newer version of Playmaker from the asset store to update the actions, but it didn't fix the problem.

I set up a very simple test using a Get Device Roll and outputting the angle in a GUI text.

There are three observations:

1- When completely horizontal, the Angle reads 1.5 instead of 0. If I roll the device to one side it gets closer to 0 and to the other side gets closer to 3.
It's like it thinks it is in a portrait orientation, even if the debug State Label shows it is in the correct orientation.

2- The total values for a 180 degrees turn seems to center at 1.57 and top at 3.14 before going negative (instead of 1.5 and 3).

3- If I start the app in Right Landscape the angle values are positive and the range goes from 3 tilting left to 0 tilting right.
If it starts in Left Landscape the value is negative and goes from 0 tilting left to 3 tilting right.

I have tried a LOT of things to fix this, but have not been successful.
Any help would be greatly welcomed.


klvo

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Device Roll wrong values
« Reply #1 on: March 24, 2013, 11:53:09 PM »
No one has any similar problems?

I know I can work around this problem without too much trouble, but if the device roll it is meant to work a certain way I am afraid it might change the behaviour again in the future and mess things up...

Can anyone suggest of a way I might be able to determine if it is a problem in Unity handling the gyroscope or if it is a problem in Playmaker?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Device Roll wrong values
« Reply #2 on: March 25, 2013, 01:11:40 AM »
Hi,

 I am currently working with the gyro, and a lot of things seem to have changed with unity 4, AND still pending for fixing, apparently planned for 4.2

Is it never working or is it when your app goes in the background or something? I'll try to have a look and test this week, can you bump me if you don't hear from me?

bye,

 Jean

klvo

  • Playmaker Newbie
  • *
  • Posts: 13
Re: Device Roll wrong values
« Reply #3 on: March 25, 2013, 07:25:19 AM »
Hi Jean, and many thanks for answering!
Good to know it is a more general problem with Unity 4 and not some isolated bug.

The problems I'm reporting are happening constantly, so there's no erratic behaviour.

I already found a way around it but I will keep an eye out for 4.2 and test to see if things are better.
Hopefully it will be fixed before the release of the app and I will be able to say it was solved in this post.

I had some problems updating Playmaker into this old project started in Unity3, some files were never overwritten no matter how many times I tried it.
I fixed it by importing into a new project and manually replacing the old files.

By doing that, the problem about my app behaving differently depending on which orientation the device had when the app started was solved, but the rest is still the same.

Is there a better way of upgrading Playmaker other than through the store?

Thanks again

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Device Roll wrong values
« Reply #4 on: March 26, 2013, 01:06:07 AM »
Hi,

the store is the most direct way with Unity.

bye,

 Jean

guisquil

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Device Roll wrong values
« Reply #5 on: June 08, 2013, 02:13:56 AM »
Hi, I have the same issue as the original poster, when the device is horizontal I get 1.5 in the roll number instead of 0,

thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Device Roll wrong values
« Reply #6 on: June 10, 2013, 01:19:15 AM »
Hi,

 I'll have a look to see if I get the same here.

bye,

 Jean

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: Device Roll wrong values
« Reply #7 on: July 02, 2013, 09:11:40 PM »
I'm having the same issue on Android, i've tried taking the action from a fresh project but i'm still getting the same results.

Have you had any luck with this Jean?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Device Roll wrong values
« Reply #8 on: July 03, 2013, 02:02:26 AM »
Hi,

 this is my next task on R.mote, so no news on this from me just yet, but it's still very much planned for me to properly give it a go!


bye,

 Jean

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • Rage Quit Games - Coming Soon
Re: Device Roll wrong values
« Reply #9 on: July 03, 2013, 06:38:34 AM »
Any idea when its due for release?

My current setup is for a 2d platformer, i'm using Get Device Roll to get the angle then i multiply the result and feed that to Add Force so that the angle always effects the amount of force applied.

I can't think of any work a rounds, can you suggest any?