Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by RickyCharles · Apr 12, 2013 at 03:15 PM · 2dtexturearrayground

Array based floor 3D game flat plane

Hey guys, I'm making a game and would like to have a tile texture based floor.

I have absolutely no idea, I hear a lot of people throwing around the idea of using an array but I have no idea how to get my array of [tile1,til2,tile3] w/e to placing the literal textures in the game.

here's a gif of what my game is like visually I suppose http://imgur.com/kbdoR3L

alt text

Any direction to a tutorial that will help with what I want would be great as I don't expect to get a whole lot of code haha! But I generally just want to be able to change between like grass, dirt, stone, road textures.

Thanks a lot guys! Love the community here.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RickyCharles · Apr 14, 2013 at 12:53 PM 0
Share

i dont know if bumping is a thing

avatar image RickyCharles · Apr 14, 2013 at 02:04 PM 0
Share

im hoping bump is a thing

avatar image kekeoki · Jun 03, 2015 at 04:33 AM 0
Share

Instantiate(myObjectArray[0], someVector3,SomeQuaternion); you can put whatever object you want to instantiate in and make the vecotr3 the place you want it instantiated and the quaternion is the objects rotation.

hope this helps! http://docs.unity3d.com/ScriptReference/Object.Instantiate.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jmgek · Jun 03, 2015 at 05:15 AM

 //Create a List or array, I like lists they are more dynamic. 
 public List<GameObject> listOfTiles = new List<GameObject>();
 //Create how large you want your map to be. 
 private int numberOfTiles = 10; 
 //Create an int that you want to use to spawn the tiles.
 private int currentTileYouAreSpawning = 0;

 private void Start()
 {
     for (int x = 0; x < length; x++)
     {
     for (int z = 0; z < length; z++)
     {
         Instantiate(listOfTiles[currentTileYouAreSpawning], new Vector3(x, 0, z), Quaternion.identity); 
         
     }         
     }
 }

With this list approch you will learn how to spawn random tiles if you wanted to. This is just the most basic of generation but it will lead you to some really cool things.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

PackTextures Horizontally? (1 Row) or Alternative Method 1 Answer

Making an array for Texture2D?? 2 Answers

Accessing a Variable From Another Script 2 Answers

2D Sprites Rendering Inconsistently Between Computers 0 Answers

RawImage flicker when changing from Texture2D to VideoPlayer texture 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges