Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

geckoo

Platform

Recommended Posts

geckoo    617

Sometimes we use always the same scripts in our projects - done one time, they help us each time. I did this one in order to manage platforms in game. A simple enumerator allows us to select axis. Of course it could be improved with other features (rotation, multiple axis, etc). However, this is a good stuff for newbies. Take a look at the way - how to move a transform ++

Please login or register to see this code.
  • Like 2

Share this post


Link to post
Share on other sites
OcularCash    929

Nice job man. You could cut out alot of those statements by using Vectors instead of floats tho and assigning a reference array alongside of the enumerator. Here is a shortened version using your exact code just using vectors and vector referencing:

 

Please login or register to see this code.

Your code will prob help alot of people. Platforms seems to be very popular in unity

Share this post


Link to post
Share on other sites

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

×