Hello Guys
I’ve been having a really weird behaviour with the RotationType enum.
This LocalScript:
local UserGameSettings_ = game:GetService(“UserGameSettings”)
local Humanoid_ = script.Parent:WaitForChild(“Humanoid”)
local CharacterRotation_ = script:WaitForChild(“CharacterRotation”)
Humanoid_.AutoJumpEnabled = false
UserGameSettings_.RotationType = CharacterRotation_.Value
Throws this error:
Workspace.robloxfoda1.HumanoidSettings:5: attempt to index nil with ‘RotationType’
(On line 5)
And this LocalScript (without the WaitForChild() on CharacterRotation):
local UserGameSettings_ = game:GetService(“UserGameSettings”)
local Humanoid_ = script.Parent:WaitForChild(“Humanoid”)
local CharacterRotation_ = script.CharacterRotation
Humanoid_.AutoJumpEnabled = false
UserGameSettings_.RotationType = CharacterRotation_.Value
Throws this error:
CharacterRotation is not a valid member of LocalScript "Workspace.robloxfoda1.HumanoidSettings
(On line 5)
CharacterRotation_ is referencing a StringVal with the Value of: Enum.RotationType.MovementRelative
What we can get from these errors is that roblox is acting like the StringVal CharacterRotation doesn’t exist, even with WaitForChild()
It’s worth noting that the LocalScript is located at StarterPlayer>StarterCharacterScripts (although I will move it to StarterPlayerScripts later, but that’s besides the point!)
Also, one question about RotationType:
The docs says it is a DataType in itself but then when you click to read about it, you get redirected to an enum index page of RotationType, how does that make any sense? For me, It’s basically saying RotationType is a DataType but then it tells me no It’s actually an enum DataType.
Thank you all for the help in advance!