Creating a reset rotation button for target manipulator


#1

I’m trying to recreate the Reset Rotation button for Target Manipulator from this post. The reset doesn’t happen no matter how many variations of this I’ve done. I’m new to coding so I’m not sure 100% what they all mean.

Customized changes to my zpp:

  • Instead of a plane,I’m using an image for my button.
  • I’ve also added rotation to all axis by adding “+rotationAmount” to X,Y,Z array (around line 80-85).

Below is a test zpp with my code following the post from above. My final product will use different images and models, the foxes are placeholders.

ResetTest.zpp (3.6 MB)

Please don’t tell me to refer to these resources.
I’ve already looked over the following for hours:
the mentioned Reset Rotation for Target Manipulator post
the scripting section of docs
video and info about activating states with scripts
controller and states doc
pointerevents docs


#2

Here you go my friend. I set the button Relative to - to Screen Left. Because the Target Manipulator touch was above the button. So you really where never press it.
I also added the rotation properties in the state controller that was missing.

Steve
ResetTestFix.zpp (3.6 MB)


#3

It worked, thank you!


#4

Your welcome :grin:

Steve