I'm trying to access the rotation of my Drawable that I have attached to a tracked cylinder. I want to then use this rotation variable across other scripts. I would also be open to using the rotation of the tracked cylinder instead of the model attached as the drawable since they are bounded together and essentially will have the same rotation.
My drawable is a prefab with a obj. and a script attached. Inside the script I set a public variable to the object's rotation.
The issue I'm running into is when I try and reference this object and grab that rotation variable from another script, I'm pointing to the generic prefab and not the active instantiated clone that is generated when the target is recognized.
For now I'm just trying to grab this variable and display it as text.
Any help with this would be amazing! Thanks
Wikitude Version 9.10.0
Unity Version 2021.3.2
Script Attached to Drawable:
public class GetCylinderData : MonoBehaviour
{
public float canRoatationRaw;
void Update()
{
canRoatationRaw = this.transform.rotation.eulerAngles.y;
Debug.Log(canRoatationRaw);
}
}
Feild Craddock
I'm trying to access the rotation of my Drawable that I have attached to a tracked cylinder. I want to then use this rotation variable across other scripts. I would also be open to using the rotation of the tracked cylinder instead of the model attached as the drawable since they are bounded together and essentially will have the same rotation.
My drawable is a prefab with a obj. and a script attached. Inside the script I set a public variable to the object's rotation.
The issue I'm running into is when I try and reference this object and grab that rotation variable from another script, I'm pointing to the generic prefab and not the active instantiated clone that is generated when the target is recognized.
For now I'm just trying to grab this variable and display it as text.
Any help with this would be amazing! Thanks
Wikitude Version 9.10.0
Unity Version 2021.3.2
Script Attached to Drawable:
Script trying to display rotation as text: