playMaker
Home
Store
Showcase
Tutorials
Forums
Manual
Wiki
About Us
Playmaker Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Join our
Discord Channel
Home
Help
Search
Login
Register
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
tilt functions on android devices
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: tilt functions on android devices (Read 3681 times)
shamo
Playmaker Newbie
Posts: 39
tilt functions on android devices
«
on:
February 27, 2018, 09:46:10 PM »
Hi all,
How does one go about implementing the tilt functions (gyro I think?) from your Android device to translate into character movement etc? I have a rough idea of putting it into action, but don't know how to call if from the device.
Thanks
Logged
djaydino
Administrator
Hero Member
Posts: 7619
Re: tilt functions on android devices
«
Reply #1 on:
February 28, 2018, 01:49:45 AM »
Hi.
I believe you can use "Get Device Roll" action.
Logged
Join the PlayMaker Discord Channel!
shamo
Playmaker Newbie
Posts: 39
Re: tilt functions on android devices
«
Reply #2 on:
February 28, 2018, 02:38:56 AM »
Thanks Djay, just found all the 'Device' settings...can't believe I didn't see them before. Nothing came up in the searches with the words I thought would match!
Will se how I go with these.
Logged
shamo
Playmaker Newbie
Posts: 39
Re: tilt functions on android devices
«
Reply #3 on:
February 28, 2018, 05:10:50 AM »
The Device roll works a treat, but can't seem to get any results from the 'Get device Gyroscope' Any suggestions? Should the 'device' be set to default (user owner) or something else?
Logged
shamo
Playmaker Newbie
Posts: 39
Re: tilt functions on android devices
«
Reply #4 on:
March 02, 2018, 05:15:49 PM »
Anyone been able to implement the 'Get Gyroscope' on Android?
Logged
djaydino
Administrator
Hero Member
Posts: 7619
Re: tilt functions on android devices
«
Reply #5 on:
March 03, 2018, 12:46:59 PM »
Hi,
Have you tested with a build on an android device that has gyro?
I don't think you can test this when using editor.
Logged
Join the PlayMaker Discord Channel!
shamo
Playmaker Newbie
Posts: 39
Re: tilt functions on android devices
«
Reply #6 on:
March 03, 2018, 06:29:35 PM »
Hi, yes testing on my HTC phone, which from what I've read uses a gyro. It has no problem running apps like a spirit level.
Logged
djaydino
Administrator
Hero Member
Posts: 7619
Re: tilt functions on android devices
«
Reply #7 on:
March 04, 2018, 08:25:30 AM »
Hi.
I tested the action and indeed it does not work,
So i went in the script and i think this never even worked.
So i rebuild the action and it should work now.
i removed the debug and gameobject as the debug does not work and can be done with different actions when needed
Also i added an event if no gyro available.
and an every frame bool (default true)
Can you test and confirm if it works?
Also if you have other ideas to add to the action let me know.
Logged
Join the PlayMaker Discord Channel!
shamo
Playmaker Newbie
Posts: 39
Re: tilt functions on android devices
«
Reply #8 on:
March 04, 2018, 08:07:31 PM »
Hey, thanks for looking into this for me, much appreciated.
I gave it a go, but cannot get it to function. I'm using a get vector3 XYZ to store the angles then output to float to string then Text set text. In the editor on play it displays an integer (as it should) On the phone it's just text... so something not communicating there.
Logged
djaydino
Administrator
Hero Member
Posts: 7619
Re: tilt functions on android devices
«
Reply #9 on:
March 05, 2018, 05:27:38 AM »
Hi,
Sorry i think i forgot to remove a part.
I did some more testing and every frame is useless in this case as the result will always be 0,0,0 so i removed that part.
here is the new version and tested on my android device
Logged
Join the PlayMaker Discord Channel!
shamo
Playmaker Newbie
Posts: 39
Re: tilt functions on android devices
«
Reply #10 on:
March 06, 2018, 06:49:44 PM »
Thanks DJ, you are a legend!
All working ok, just refining how to implement it with the animations/ state machine setup I have.
Any suggestions how to change the reading from the Attitude Euler angles from 1-360 to 1-180 and -1 to -180?
Thanks
«
Last Edit: March 07, 2018, 05:18:20 AM by shamo
»
Logged
pierre nay
Playmaker Newbie
Posts: 28
we used a vax to render spheres
get device gyroscope action does work on android here
«
Reply #11 on:
July 31, 2019, 03:15:57 AM »
'Get device Gyroscope' action on the ecosystem isnt updated so it does not work with ANDROID but the one linked to this page does, thank you.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Playmaker Forum
»
PlayMaker Help & Tips
»
PlayMaker Help
(Moderator:
600
) »
tilt functions on android devices