Animating Your Avatar In VR

Update:

Looking straight down before switching to third-person only seems to fix the issue if I’m sitting down in real life. If I’m standing, the bug persists in third-person no matter what direction I’m looking.

Also, this bug seems to be caused by VRService.AutomaticScaling. Turning off AutomaticScaling in third-person seemed to fix the problem entirely.


Another bug I discovered:

If you’re in first-person and you push in on the left thumbstick to recenter the camera, you will be completely unable to rotate your avatar in third-person (and in first-person, if VRService.AvatarGestures later gets disabled).

This is because, with AvatarGestures enabled, Humanoid.AutoRotate is automatically set to false in first-person, and goes back to true in third-person. However, for whatever reason, if you recenter the camera in first-person, Humanoid.AutoRotate will no longer automatically change, and it will stay false forever.

Humanoid.AutoRotate also does not get re-enabled if you disable AvatarGestures while in first-person, and likewise, it does not get disabled if you enable AvatarGestures while in first-person.


Here’s some code I wrote as a workaround until these issues are actually fixed:

Code
local userGameSettings = UserSettings():GetService("UserGameSettings")
local vrService = game:GetService("VRService")
local camera = workspace.CurrentCamera
local hum = nil --put your humanoid here...

--toggle AutomaticScaling and AutoRotate dependent on camera modes, to fix bugs with AvatarGestures
local function fixAvatarGestures()
	local rotationType = userGameSettings.RotationType.Name
	
	--third-person
	if (rotationType == "MovementRelative") then
		vrService.AutomaticScaling = Enum.VRScaling.Off
		camera.HeadScale = 1
		
		if hum then
			hum.AutoRotate = true
		end
		
	--first-person
	elseif (rotationType == "CameraRelative") then
		vrService.AutomaticScaling = Enum.VRScaling.World
		
		if hum then
			hum.AutoRotate = (vrService.AvatarGestures==false)
		end
	end
end

--fire when you change camera modes or toggle AvatarGestures
userGameSettings:GetPropertyChangedSignal("RotationType"):Connect(fixAvatarGestures)
vrService:GetPropertyChangedSignal("AvatarGestures"):Connect(fixAvatarGestures)

--immediately disable AutomaticScaling since you initially spawn in third-person
fixAvatarGestures()
2 Likes

Here’s a few issues I’ve noticed.

  1. Character shakes while in a moving vehicle
  2. Character’s arms shake when the headset shakes
  3. part.touch buttons don’t work when the character is sitting.
1 Like

FYI, it seems like these added parts / IK controls break many vehicle controls. Do you have any reports of this?