Hello everyone. I’m making an air hockey game for my first project because I thought it would be fairly easy. The problem I’m having this far is that when the paddle (cylinder) hit the puck (cylinder) the puck goes vertical and spins. I thought that I could keep the puck laying flat by resetting the rotation to 0 via the puck script’s update function:
function Update () {
if(transform.rotation.y > 0){
transform.rotation.y = 0;
}
else if(transform.rotation.x > 0){
transform.rotation.x = 0;
}
else{
transform.rotation.z = 0;
}
}
This of course did nothing. What am I not doing right?
Also how can I reduce the friction so the puck slides more realistically?