The orientation of mobile devices wont change when altering the screen rotation property of PlayerGui

I am trying to make the screen rotate on all mobile platforms when they are using a certain GUI however the screen just wont rotate, by the way I am using the emulator to verify this property.
here is my relevant code:

    --function:
local ChangeScreenRotation = function(Orientation)
	PlayerGUI.ScreenOrientation = Orientation
end
--function call
 ChangeScreenRotation(Enum.ScreenOrientation.Portrait)

Personally, I’m not even sure why you’re using a function for this when you can just set the orientation directly. There’s also not enough code to go off of - like, what is PlayerGUI assigned to? It’s probably the player’s PlayerGui, but it’d be helpful to know for the sake of further knowledge of this problem.

Im using a function because I use it alot and it improves the code maintainability