Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Rathanak · Oct 14, 2011 at 03:39 AM · iphone

how to make chess board

Hi Can everyone tell me how can i make chess board..? can you give me simple code to make chess board. i am new to unity..? or can you tell me step to create chess board.....

thank

Comment
Add comment · Show 4
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 syclamoth · Oct 14, 2011 at 03:48 AM 0
Share

Step one: Open up Blender

Step two: $$anonymous$$ake a chessboard.

Unity is not exactly optimised for mesh creation! If you were really deter$$anonymous$$ed to make something like this, you could use unity's inbuilt cube meshes, and put them together in a grid. Then, just change the textures on every second one so that they make the traditional black-and-white pattern.

Of course, if you are talking about an entire chess game then that is a different matter entirely. That is not a question you can just ask like that, because it is complex enough that there are lots and lots of ways of doing it, each tailored for a specific use case, and there is no way of knowing from your one-and-a-half line question exactly what it is that you want to do!

Basically, I can't really answer the question, because as far as I can tell there isn't even a question to answer here.

avatar image Rathanak · Oct 14, 2011 at 04:02 AM 0
Share

thank you for your comment ..... now i only want to know on how to make chess board... because i am new on unity and i don't know much about unity and i want to work on it... can you tell me how to combine cube and meshes ?

thank

avatar image DaveA · Oct 14, 2011 at 04:33 AM 0
Share

What ever happened to using 'answer' to answer a question?

avatar image timsk · Oct 14, 2011 at 10:47 AM 0
Share

Just as a note, think out your questions more. For instance:

"i am new to unity..?" Is not a question ;) and:

"Can everyone tell me how can i make chess board..?" The answer to that is No... Everyone in the world could not tell you how to create a chessboard for / in unity.

I know its nit-picking, but it shows a lack of effort on your part.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by timsk · Oct 14, 2011 at 10:45 AM

You don't "combine cube and meshes" a cube contains a mesh (the mesh is what makes up the cube ;)).

I would check out this post:

Unity Learning Resources

And also, have a look at unity's FPS and platformer tutorials, they are very detailed and walk you through a lot of core elements of unity.

Also, it sounds like you need to learn a bit more about the 3d modelling side of things (coming from the quote at the start of this answer). I would suggest 3dbuzz.com for this. Altho, if you type "3dsmax tutorial" or "maya tutorial" in google, you will get some good results. Also, it depends what 3d package you have, if you don't. Do some research on the ones available and take your pick.

Altho you don't realise it, you have summarised many questions into 1, unanswerable, vague question. Once you learn more, you will come across specific questions that people can directly answer to help you. You have to help yourself in the meantime.

@DaveA Syclamoth actually said "I can't really answer the question" ;)

Technically, neither can i. But i have attempted to point him in the right direction so that he can answer his questions himself.

Comment
Add comment · Show 2 · 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
avatar image Rathanak · Oct 15, 2011 at 02:04 AM 0
Share

Thank you so much for you advice..... i will try to do what you told me to do.... :)

avatar image DaveA · Oct 15, 2011 at 06:08 AM 0
Share

I would have up-voted Syclamoth if it had been an answer.

avatar image
0

Answer by tecmind · Oct 06, 2020 at 10:17 AM

Try this one: 1. Create prefabs 1x1x 0.3height for the white and black pieces; 2. Create an C# script and use the code bellow. If your code name is CreateBoard, just copy and paste bellow the class brackets; 3. Create an empty GameObject in the Hierarchy and drag the code to it; 4. In the array, use 1 for one board style or more according. Drag the white tile to the tileswhite array. Drag the black tile to the tilesBlack array. I've created an array in case you need to use diferente tile materials, but if you don't, remove the [] from the GameObject [] tilesWhite and [] tilesWhite; 5. I hope this helps you;

public class CreateBoard : MonoBehaviour { public GameObject[] tilesWhite; //If use one board design, remove the array. public GameObject[] tilesBlack;

 int[] boardTiles = {1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1};
 public int tilesType = 0; //Type of material of the tiles, fed in the tilesWhite/Black array;
 
 void Start()
 {
     for(int r=0; r < 8; r++)
     {  
         for(int c=0; c < 8; c++)
         {
             if(boardTiles[r * 8 + c] ==0)
             {
                 Vector3 pos = new Vector3(r, 0, c);
                 GameObject tile = Instantiate(tilesWhite[tilesType], pos, Quaternion.identity);                
             }else
             {
                 Vector3 pos = new Vector3(r, 0, c);
                 GameObject tile = Instantiate(tilesBlack[tilesType], pos, Quaternion.identity);                   
             }
         }           
       
     }

 }

}

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
avatar image
0

Answer by Scharbil · Nov 03, 2021 at 08:28 AM

Try this. In the inspector you will only need to set the number of row and collums you want for your board and the materials for each square:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 public class CreateBoard : MonoBehaviour {
 public GameObject Square0;
 public GameObject Square1;
 public int width;
 public int height;
 void Start() {
       for(int r=0; r < width; r++)
      {for(int c=0; c < height; c++)
          {  if((r+c)%2==0){Instantiate(Square0,new Vector3(r, 0, c),Quaternion.identity);} else
             if((r+c)%2==1){Instantiate(Square1,new Vector3(r, 0, c),Quaternion.identity);}            
          }          
     }
   }
 }

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

7 People are following this question.

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

Related Questions

Why does my sound play multiple times using touchcount? 1 Answer

Command line builds for iOS - pro only? 0 Answers

NGUI resizes fine in engine but not on actual devices 1 Answer

GUI refresh time on platforms slower than Unity Editor 1 Answer

Unity 4.6, set up iPhone 5 sized portrait pixel perfect canvas 0 Answers


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