blueprint

The parent piece for all my pieces in the Chess project!

  • Exposure: public
  • UE Version: 5.3

AlijaA

April 18, 2024, 4:48 pm

In this code snippet, I show you how I created the parent piece logic for all of my other pieces: When the game starts we get our player controller so that I can cast to it and create an event to select my piece. The material then changes to communicate that the piece has been chosen. I also have an event where through an Enum we can check if we are the right team so that we can't control the opposite pieces. We then have a function that I made where it gets all possible moves, and if the piece is valid on the board to which we have the reference, it will then give us our possible moves.

I also have a tile system where every individual tile has information on it, this system is used for us to gather information on which piece can move where and so that we can teleport the pieces to the different move locations. We then have a timeline so that we can show the piece moving.

Click the button above, it will automatically copy blueprint in your clipboard. Then in Unreal Engine blueprint editor, paste it with ctrl + v