Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    5
  • comments
    0
  • views
    417

Grids Pro Asset Offset

Brayden Beavis

447 views

 

Colony 7 relies on a grid system for assets to snap together, this is so that when an asset is in the way of the player, the player is unable to move to that space. At the beginning of the project the team were unfamiliar with Magicavoxel and how it worked, what we hadn’t originally taken into consideration is:

If I create a floor piece that is one unit deep on the Y axis;

image.png.8d652b6e677160640619eacc7d077ff1.png

Then I make a toolbox to sit atop of the floor, on importing into Unity, the tool box would be sitting one unit inside it.

However, if when I created the toolbox, I had started it one unit higher to count for height of the floor, this could have been avoided.

image.png.8d198101d88d470214c6c47f6b5eb104.png

 

With a ‘two birds, one stone’ approach, fixing my problem and fulfilling my programming learning outcome, I created an offset script for the assets so that they would still sit correctly on the grid for functionality. Essentially the script adjusts the transform of a child in the Y axis whereas the parent object sits on the grid. This script is able to be applied to any object that needs a slight adjustment rather than having to account for the unit height of asset placement inside of Unity when building the level. This script also made changing the design of the level easier as the assets could be placed anywhere using this script, while still fitting on the grid.

5a2cc2ebcfe21_ezgif.com-video-to-gif(3).gif.59ffb0acc23b827f6759cb3dc3e2fa75.gif



0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!