It does the rotatation. It checks if raycast is true, and if so, it sets hilf to true and if not, it’s false… so based on what you’re describing, it’s always hitting something and the raycast is never false.
There’s no code that updates your ray. You’re rotating an object but raycasting the same thing over and over again so of course it’s never going to be false.
Yeah, is just that the part where you code the if statement: if((Physics.Raycast (ray,out hit, 100)) == true){ is always true and it’s looping because your variable “hilf” is always assigned to be true. As a suggestion I would recommend having boolean variables declared before so that you could validate it in your loop and get out of the loop when they get activated. It saves a lot of time. Good luck!