Search Knowledge Base by Keyword
Note: click here if you are using an older version of Zoe for Unity (1.x).
Drag & Drop is the ability to set a target place for an object to go into (in this example, the hat is dragged and dropped on the character’s head). This feature is extremely useful to define snapping zones for any type of experience if you want your user to place an element at a specific spot.
Follow the steps below to setup the Drag and Drop for a given IO:
- Create an IO that will be the object that is dropped inside a target (see the Create Interactive Objects section to know how to do it);
- Check Enable Drag And Drop at the root of the Object;
- Now you can setup the options.
- Choose among all IOs in the scene the target(s) for your object to be dropped on. You can have several targets for one object.
- Alternatively you can generate automatic targets by entering the number of targets you want and clicking on the
Automatic Drop targets have a Box Collider at their root by default. Make sure to remove it in order for the Drop to work.
Warning: in this version of the plugin, when a target is generated it will clone all the interactions you already have inside your object, so make sure to remove them or change them according to your needs.
Set here the requirements for how the user needs to place an object on a target in order to do a valid drop.
- Min Distance for Valid Drop: the distance between the drop object and the drop target. If not within this distance, the drop is not allowed.
- Match orientation on X/Y/Z Axis : check these if you want the drop object to match the orientation of the drop target (choose among axis) in order to allow the drop.
- Allow mirror: this option is available if an axis is mandatory. It allows you to validate the drop if the object matches the axis orientation both in positive and negative directions. This is useful for objects that don’t necessarily have a front/back, objects that are symmetric like a cylinder, etc).
- Angle Threshold: represents the precision in which the orientation of the drop object on the drop target should be as a percentage. I.E. if the threshold is set to 100 it means the object needs to match at 100% the axis orientation. This is useful for setting the level of difficulty to the user when dropping an object into a target.
- Allow drop on occupied targets: allow to drop an object on a target even if another drop object is already there.
- Lock after dropped: lock the object at the target position when it has been dropped.
- Snap on drop: snap into target’s position when object is dropped.
- Time to Snap: duration in seconds of the transition for the drop object to match the target position when the user releases it into the target.