Gyroscope Position Help

Hello everyone,

It’s been a while that I don’t post anything here and now I’ve come back with a maybe “simple” question for you guys from support! I would like to know if is there any way to get the rotation value of a gyroscope or if is even possible to do it. I’ll be watching. Since now, thx,

att, Higor :slight_smile:

I’m waiting an awnser :confused:

Hello Sebastian,

Thx for awnser me. No problems with the late response. About the problem… There’s how you show me an example? I didn’t think that doc was clear enough about my problem.

Thx,
Att, Higor.

Hi Higor,

What the documentation is explaining is that, you can retrieve the rotation value from a node in your hierarchy using the rotation getter function.

So for example, let’s say you have a node called “cube” in Studio and its ‘x,y,z’ rotation values are

[15,180,0]

You would then access its rotation values by declaring a new variable and assigning those values to the new variable, like so:

var rot = cube.rotation();

In this case, the new variable ‘rot’ now holds the value [15,180,0], which are the “cube” node’s rotation values.

This same process can be used to retrieve the rotation values of an Attitude Orient node. The link below provides more information on how to use Attitude Orient nodes, so it’s worth having a read through.

https://docs.zap.works/studio/gyro-oriented-environments/

Hope this cleared things up a bit for you.

Thanks,
Seb

*EDIT: While this method of retrieving a node’s rotation values is correct, it can not be used on an ‘Attitude Orient’ node as I’d incorrectly mentioned. Apologies.

1 Like

But I did this Sebastian and nothing happens. I may show you my script if you want but I did ecxatly the same thing in dif ways and never happen something. The values don’t come back. What may I do about it?

Thx,
att, Higor.

Also, here’s the code:

Z.after(1000, ()=>{
   text0.text(attitudeOrient0.rotation().toString());

})

I passed it to a string to see if will come back any value just test, but nothing happend.

Hi Higor,

I’ve just been told that currently, the rotation getter function does not work with ‘Attitude Orient’ nodes. I’ve edited my previous responses in this thread to reflect this. Apologies for any confusion caused.

Thanks,
Seb

1 Like

No problem at all. But if there’s no how you get the rotation value of an Attitude Orient, how did the Tom & Jerry Game was made? Also, I remember that in the forum has something about this but I didn’t find the post. May you explain for me Sebastian?

Thx again,
att, Higor.

Hi Higor,

I believe the forum page you are referring to is the following one:

Our creative team found a way to work around this limitation, however, as mentioned in that forum page, we are unable to share the project or any of the code from it as it was made for a client. Luckily, they were kind enough to provide a description of how they achieved this so it may be helpful to have a read through that post.

Thanks,
Seb

1 Like

Hello Sebastian!

Sorry by awnser this or give the necessary attention too late as this. Well, I saw this post and the explanation, and I reproduced it as indeed. The problem is: it worked but don’t worked. The mechanic is so so… Then I came back to ask to you guys if it is possible evaluate my project. I have the ZPP here. Just awnser with the correct local to send it. I’ll be waiting an awnser.

Thx,
Att, Higor.

Hi Higor,

We can certainly have a look at your project. Could you send the zpp over to support@zappar.com, along with a detailed explanation of the issue you are experiencing.

Thanks,
Seb