What is the best way to move a chess piece correctly?

Hey guys,

I’m trying to make a chess game, and am having quite a bit of trouble figuring out the best way to move chess pieces in their correct “movements”, while still making sure they can’t move to a previously occupied space, or off the board. I have thought about physically moving the chess piece, and that seemed like it would be ineffective in my project; I also considered having a “Game Manager” keep track of what is in use, and what isn’t, but I couldn’t figure out a clean way to do it. I am still open to any of my previously mentioned methods, as I am sure I don’t know about every feature Unity has packed into its version of C#, and could have forgot about something! If you guys have any other ideas, or can think of some way to get my perviously mentioned ideas to work, I will be very grateful!

Thanks for all your help, guys! Remember, every comment can help! ∆ Gibson

Personally, I don’t think a game manager is a bad idea. Could generate a script with just a bunch of static functions that will animate the pieces accordingly, and you could dynamically call those functions to animate each piece as needed.

But yeah, you’re going to need something showing where each piece is and when it’s there. Maybe a two dimensional array can represent the board and you can keep track of pieces inside of that. I mean depending on what exactly you’re doing you’re going to have to explore a lot of options and choose what works best for your particular needs.

Even what I offered may not be the best solutions for you, those are just what jumped to my head first. And just out of curiousity, why wouldn’t you be able to move a chess piece back to where it was? Isn’t that allowed in chess?