Hello all,
i am trying to create an interactive application for the 1st time.
i want to create a chess board and want to access every block of the board on mouse click on that.
anything will be really very helpful for me.
Thanks in Advance!
Niki.j
Hello all,
i am trying to create an interactive application for the 1st time.
i want to create a chess board and want to access every block of the board on mouse click on that.
anything will be really very helpful for me.
Thanks in Advance!
Niki.j
consider not using “pixels” and use blocks.
Each square is a cube of whatever color. Then simply put a script on each cube that does something when the mouse is down.
You want a GameObject + Collider per block. Then ScreenPointToRay to interact with them.
Poke, Poke
Thats what OnMouseDown does. ![]()
Pretty cool for PC. At this point I just assume everyone is going to mobile.
Hello all,
thanks for your suggestions.using the colliders and the different textures for all the blocks is a good alternative.
but i want to use the pixels.
i found some references for getting pixels and setting pixels in the unity
SetPixel() and GetPixel(),but i haven’t done anything with them yet.
what i want to do is:
i have a texture of chess board and on click of every block already designed on the texture i want to print the row-number and column-number of the block.
Any suggestions,and improvements will be most welcome.
Thanks in Advance!!
Niki.j