i am making a pipes connecting game in which when all the pipes are on correct location you win the game. I need a script that can take the pipes correct rotation on z axis before the game start or in OnEnable method when correct rotation is taken then it use a random function to randomize the rotation of all the pipes on z axis and when the mouse button click on the pipes the pipes rotate 90 deg on one click then a loop compare correct rotation with the rotation on the play mode if rotation match with the correct rotation then show matched message in console and a game manager script in which the 2 methods are written. one is the method in which count increase when the pipe is on correct rotation and the other method is when pipe move from correct location it decrease the counter but not alwys decrease it only decrease counter when the pipe move from correct rotation to other
i have just 1 issue while writing this script that few of pipes not work properly either the assets are same setting are same and script are same which is attached to all pipe its works perfectly on majority of pipes but not working on few pipes everytime different when i start the game . So i need a script i wanna check that what problem i am making with the script and give me script so i learn from it