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 JoseGarrido62 · Feb 08, 2021 at 06:50 AM · mouse-drag

Why are there so few tutorials on 3D chess in Unity?

There are an enormous amount of Unity courses from Unity 4.x to Unity 2020 on Udemy and not one has a basic 3D chess game - regular 3D or VR 3D. There are some on YouTube, but the best ones for beginners is in console C, and that does not help me in Unity.

I was able to set a board and chess set and implement drag and drop but it is not working that well. I want to be able to highlight the square to show where a piece can move, chess piece selection, etc. My idea is more for learning openings and have not even considered an engine until I have experience. I want to implement some features that 2D side scrollers have like winning coins etc. for making the right move.

It seems a basic chess game is not worth an instructors time. The only chess game course on Udemy is the one using Visual scripting with Unreal but I don't want to go that route. I want to stay with Unity.

Having said that, I am wondering if I should consider making the game in 2D before jumping into 3D and eventually VR. My end goal is VR for everything to be honest. Anyone have any thoughts on All this?

If I had money, I would find someone to help me but that is currently not an option, even for $1 a minute.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Llama_w_2Ls · Feb 08, 2021 at 07:35 AM

Chess is a simple game in design, with endless complexities within it, such as openings, special moves such as castling and en-passant etc. Chess in 2D, and 3D are almost identical in my coding experience, but I would start off with 2D, as it is easier to get your head around the code design in 2D.


I'm guessing it's not that popular among tutorials, since it is an intermediate or even advanced coding experience, as you'll have to work with making smart AI later down the line, and efficiencies in win-checking and check/checkmate etc.


As with other board games, such as tic-tac-toe, you define a grid, and you create the grid in a way, so that you can easily win-check. For example, loop through the grid and see if diagonal pieces line up etc. For chess, the grid is much larger, but the pieces' movements are constrained, which make knowing where the piece is allowed to move, a little simpler, but win checking ultimately harder.


For example, for the pawn, you could write a script like this:

 public bool HasAlreadyMoved;
 public bool PieceToTheLeft;
 public bool PieceToTheRight;
 
 public void ShowMoves()
 {
      // Moving this piece
      if (HasAlreadyMoved)
           // Highlight square in front of it
      else
      {
           // Highlight two squares in front of it
           HasAlreadyMoved = true;
      }
 
      // Taking pieces
      if (PieceToTheLeft)
           // Highlight square infront and to the left
      if (PieceToTheRight)
           // Highlight square infront and to the right
 }
 
 

The PieceToTheLeft bool and the PieceToTheRight bool can only be assigned values when you define a grid, with spaces to move. If you want to know how to do this, let me know below, and if you find anything confusing or not answering your question, please ask. @JoseGarrido62

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

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

Right click drag and drop script 1 Answer

Tracking slow mouse movements 1 Answer

Move rigidbody2D with AddForceAtPosition relative to mouseclick (no snapping) 1 Answer

I need help with moving an object on only the Y axis with mouse input 1 Answer

Handles Mouse Event Drag not working 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