Quick Start Guide
Getting the Decorating Toolkit up and running in your project only takes a few minutes. Follow these steps to set up your first draggable object.
1. Prepare your Player
- Add the
PlayerDecoratingControllercomponent to your main Player GameObject (the one that handles your camera or movement).
TODO: screenshot of the PlayerDecoratingController
2. Create your Settings
The toolkit uses a central settings asset to keep everything organized.
- Right-click in your Project window and select
Create > DecoRat > Decorating > Toolkit Settings. - Assign this new asset to the Settings field on your
PlayerDecoratingController. - Set the dragginLayerName to a new layer that you want to use for draggables.
- Set the dragginglayerName to all objects you want to drag.
TODO: screenshot of settings being set
3. Hook up your Input
The toolkit is pretty flexable It just needs a "Pointer Source."
Option A: Create new Pointer Source
- Create a new script that implements the
IPointerSourceinterface. - Attach your input script to a GameObject and assign it to the Pointer Source field on the controller.
Option B: Use an existing example Pointer Source
- Attach Sample Input System Pointer Source to the controller.
- Assign the Pointer Camera with your main camera.
- Set the Pointer Source in your Controller.
4. Make an object draggable
When making an object draggable you have two options.
Option A: Physics-based (Rigidbody)
Use this for objects that use phyisics while being dragged.
- Add the RigidbodyPlaceable component.
Option B: Static
Use this where the object shouldn't interact with physics.
- Add the StaticPlaceable component.
5. Configure the behavior
Before you can start dragging, you need to define how it feels.
- Create an Interactable Profile, Physics Drag Profile, and Static Drag Profile (found under
Create > DecoRat > Decorating). - Create a Placement Validation Profile to define where objects can be placed.
- Assign these to your
DecoratingToolkitSettings. These profiles control things like lerp speeds, collision masks, and more.
6. Test it
Press Play, click on your object, and try moving it around.
Demo
There is an example scene in the Examples folder that you can use to test the toolkit.
You have to manually add the 'Dynamic' layer to your layers and add those to objects that need to be moved.
Want to add grid snapping? Check out the Grid Dragging guide.
Want to know more about the objects? See Objects (Placeables).
Check out the Samples to see it in action!