triggering animation on specific transformation value

hi, im working with augmented reality tool kit and want the animation to be triggered when the marker is positioned or rotated at a specific value.

I have an image plane which is broken into parts and been distorted and placed in 3D space. The user need to rotate the marker to get the perspective to match the broken parts to be able to see the image as whole.

I want the animation (for example fade out) to be triggered when the marker reaches that specific transformation value. Is there any script that allows to do this? if so, can you provide me a script?

Thanks

I’m not sure there is an existing script to do this, but it is fairly straightforward to compare the transform components separately. It isn’t a good idea to check for exact equality, but rather to see if the properties are within a small range. You can check the distance between the actual and desired position using Vector3.Distance. Two rotations can be compared for similarity using the dot product of the two quaternions. The product will be 1 when the rotations are exactly the same and -1 when they are opposite. Choose a threshold value close enough to 1 to look neat but not be impossible for the player to get right.

Hi, thanks for reply.

Do you think Transform.eulerAngles would also help in this kind of situation?

Thanks.