Target Manipulator Reset Rotation


#1

Hey guys.

Quick question. I’ve implemented the Target Manipulator in a project and it works fantastic! Is there a way in which I can “reset” the position of say a 3d model to it’s original position from via Pointerdown script?

For instance if I’ve rotated the model (by use of the Target Manipilator), pressed and opened another screen/scene states via buttons, and then return to the original default state via pointerdown button, the 3d model will be where I left it after I rotated it. But is it possible for it to reset to the original position (before I manipulated the rotation via the Target Manipulator) when I return to the default state via code in the Pointerdown script.

Hope that makes sense :slight_smile:

Thank you!
Len


#3

Hi @westcreations,

Thanks for the question!

I’ve replied to your support ticket directly but I think this is something that other users may get stuck on, so I’ll copy the reply on here also.

The target manipulator doesn’t actually rotate the model itself, it works by rotating a group within the sub symbol named ‘model group’. Assets within this group automatically become relative to it, meaning when the group is rotated, everything within it follows.

The way that the target manipulator is created allows the ‘model group’ to be exposed from within the parent symbol (see target maniuplator set up video) and assets to be dragged directly into it. For us to reset the rotation of anything in this group, we will have to create a reset state in the sub symbol and activate that within the parent symbol.

  1. Set up a controller with a reset state within the target manipulator subsymbol.

  2. Select and add the ‘model group’ rotation properties using the + when the state is selected in the controller list.

  3. Create an exported function in the rotate and scale script and activate the reset state inside the function. Example can be seen below -

  4. Create a button (plane) in the parent symbol and add a pointer down script to it.

  5. Within the pointer down script, drag and drop the target manipulator from the hierarchy to get a reference of it.

  6. In the pointer down event, please add -

Target_Manipulator.nodes.Rotate_andScale.reset();

When the button is pressed, the model group rotation values will reset to 0,0,0 along with everything within it!

Hopefully this step-by-step explains all the key points in enough detail for this to be achieved :slight_smile:

Hope this helps!

George


#4

Hi @George

Thank you for the awesome detailed reply and assistance, much appreciated!

It worked great thank you! :slight_smile:

Take care
Len


#5

Hello @George,

I was studying a bit this symbol and I noticed that when you increment the scale, the object that is being used just overcome the tracking. So, I’m trying to do something like:

while you are incrementing the scale, the GroupToModify increment his Y position axis but I’m not having sucess on this. Everytime I try, my object just disapear or don’t work. Can you give me some direction about how to do this?

att, Higão.


#6

Hi @higor,

Would it be possible to send an example ZPP of what you are trying to achieve to support@zappar.com so we can try to understand this further? Or alternatively, please send screenshots so we can try to work out what is causing the object to disappear while scaling.

All the best,

George