In this lesson, we are going through two ways of placing props on your map efficiently. This Object Generator is useful when you want to place lots of assets in your scene without using a Terrain or when you need foliage at a specific place. It is also useful if you want the player to interact with those objects as they are all Core Objects. For example, you can spawn templates with scripts.
Placing objects with your cursor (X)
To place objects in your scene, you can select an object in the Core Content or Project Content and press the key X while moving your cursor in your scene. A new instance of this object is placed at the position your cursor is pointing at.
For more control on the object that is spawned, you can open the Window > Object Generator and tune the parameters. Press Shift + X to apply those parameters. You can randomize the scale, the yaw (which is the rotation on the Z-axis), and even the color of the Base Material (red, green and blue values between 0 and 1). You can also use Spawn Upright or Only Spawn On Terrain for specific use-cases like trees.
Placing objects under another asset
Core comes with a tool that allows you to place lots of objects in a zone with random parameters.
To use this button, place any asset on your map (triggers or any cubes are recommended). After scaling this asset above the zone you want to cover, select it in your Hierarchy and select an asset in your Content. Everything is now set up, you can then press the Spawn Selected Asset Under Selected Hierarchy Object button. You can also use Spawn Upright or Only Spawn On Terrain for specific use-cases.
The 4 parameters under the button give you more control over the spawned assets:
In-Between Distance is the medium distance between objects.
Position Randomness is a random offset. If set to 0, all objects are aligned on a grid where one cell is the size of In-Between Distance. If set to 1, the offset position can go up to the In-Between Distance.
Max Allowable Slope is an angle from which objects won’t spawn. If set to 60, then the items can spawn on objects or terrain with a slope lower than 60 degrees.
Put Objects In Group create a new group in the Hierarchy containing all the generated objects.
Try it in Core! Add the last objects in your scene using the object generator or the X shortcut. Custom the sky and the post-process effects to change the atmosphere of your game.
Strictly Necessary Cookies
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
3rd Party Cookies
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
Leave a Comment
You must be logged in to post a comment.