For my TD game i made it so that the enemies will turn 90 degrees when coming in contact with a glowing part, but when they come in contact with it, they are always turning 45 degrees. Any solutions?

Did you use math.rad() whilst rotating?

Would be helpful if you could provide the code you used. We can only guess as to what the problem might be otherwise

No, i didn’t

Here’s the code because i forgot.

Enemy:SetPrimaryPartCFrame(Enemy.HumanoidRootPart.CFrame * CFrame.fromEulerAnglesXYZ(0,90,0))

Sorry, i forgot to add it

Enemy:SetPrimaryPartCFrame(Enemy.HumanoidRootPart.CFrame * CFrame.fromEulerAnglesXYZ(0,90,0))

Yes, so what you need to do is use math.rad() to convert radians to degrees.

```
Enemy:SetPrimaryPartCFrame(Enemy.HumanoidRootPart.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(90),0))
```

Like @Synthetic_Flame said above, you can use `math.rad()`

to convert your angles from degrees to radians, as CFrame operations use radians. You could also just use radians directly with the knowledge that 90 degrees = pi/2 radians (so in Lua that would be `math.pi/2`

)

Thanks alot, this line of code worked