Object Placement
Guide on how to integrate placing buildable units with Unit System demo scripts.
Last updated
Guide on how to integrate placing buildable units with Unit System demo scripts.
Last updated
This page is for guiding you through the process of basic integration for package. Refer to the if you need more information.
If you do not have Object Placement package present, then follow it's guide for import and scene setup:
Create empty object and add ObjectPlacement
component to it. Check all the tabs and configure it for your project.
Units may use their colliders by default if one is present, otherwise follow to configure bounds for each units as well.
Add EntityPlacementManager
which will handle all the events for your and start object placement when a request is invoked. You can replace this script with custom event handling for the request.
Placements are requested by Production Module when production request is processed that requires building and therefore placement in the world.
While placing an object selection is still active and may interfere with placement by highlighting objects or even selecting them.
There are few ways to achieve this and here are two:
If you are using Unit Selection asset, then you may use the additional ActivePlacementSelectionToggler
script which does only this, observe the placement events and enables/disables the UnitSelector
.
For any integration you can always set up events of the EntityPlacementManager
by yourself in code or directly in the scene.