Animating Your Avatar In VR

pretty sure you can do this yourself with some api maybe opentrack?

I found a fix for this

game.UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.ButtonX then
		local HumanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
		HumanoidRootPart.CFrame = CFrame.new(0, 0, -10) * HumanoidRootPart.CFrame
		workspace.CurrentCamera.CFrame = CFrame.new(0, 0, -10) * HumanoidRootPart.CFrame
	end
end)

all you have to do is teleport the camera with the player and it’s all good

Oh, sooo that’s what the FastFlag was about.

This is like NexusVR

@TheNexusAvenger opinions? :thinking:

I wonder if character appearances break it like the script, probably not

What is handling the replication? I guess here, it’s not doing the same thing as the FootPlanter in NexusVR.

This currently does not have foot planting, and I plan to drop it as part of the V3 release as I don’t want to mess with the character when Roblox is managing it. Not sure if Roblox plans to address foot planting with these types of small movements, but it would help both VR and other first-person games with strafing.

What I don’t know what will happen is. If you’d attach physics. Be it on NexusVR or with the new AvatarGestures.

e.g. attach a Rope to a hand and then move it

 

I am still wondering what the cause of the crash here exactly is

I think those might be all relatable.

Okay, this is awesome! After a Roblox Studio update (or something) completely broke Nexus VR Character Model, I couldn’t really “test” anything in virtual reality anymore. Nexus said something about talking to Roblox about an official way to move the player’s hand and head, which made me hope that they would do it.

Recently, Roblox posted the spring 2024 roadmap and one thing caught my attention, VR avatar movement? An official counterpart to the character model? :shock:

I thought it would be a couple months before that cool feature was released, but I didn’t expect it to come so soon!

I’ve read about the limitations of this feature in this topic, but I’m still feeling interested in trying it myself (as soon as I find my Meta Quest 2).

If there’s one thing I’m still wondering about this, it’s whether the movements are visible server-side. With Nexus VR Character Model, characters were almost completely motionless on the server, but since this is native, perhaps it actually replicates? I would love that!

3 Likes

Roblox about to become the movie Ready Player One. Its crazy how much Roblox has grown.

1 Like

This is a great update!

I feel as if not many developers will take advantage of this, however.

I suggest either having a little popup to let people know of the new VRService features, or to be a little more intrusive keep the new gestures active by default (activates on next publish). Developers could obviously disable it before publishing if it is a problem.

6 Likes

This is an absolutely amazing update! I cannot wait to try this out sometime tomorrow!

1 Like

I don’t think that activating it by default would be good since it could possibly mess up something in the game but the pop up would be good

Here are some problems and their fixes

Teleporting in first person doesn't work properly

teleporting in first person is glitchy since the character will want to teleport but it wants to return to the camera

Animating Your Avatar In VR - #9 by TheNexusAvenger

Here’s his script to teleport:

game.UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.ButtonX then
		local HumanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
		HumanoidRootPart.CFrame = CFrame.new(0, 0, -10) * HumanoidRootPart.CFrame
	end
end)

There’s an easy fix to this:

game.UserInputService.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.ButtonX then
		local HumanoidRootPart = game.Players.LocalPlayer.Character.HumanoidRootPart
		HumanoidRootPart.CFrame = CFrame.new(0, 0, -10) * HumanoidRootPart.CFrame
		workspace.CurrentCamera.CFrame = CFrame.new(0, 0, -10) * HumanoidRootPart.CFrame
	end
end)

All you have to do is teleport the camera with the HumanoidRootPart so the character wont walk back to it

Some accessories may obscure the view

in first person if you are wearing specific accessories then your view may be obscured

Animating Your Avatar In VR - #28 by hunterk1241

Here’s a script to fix that:

local player = game.Players.LocalPlayer

player.CharacterAdded:Connect(function(character)
	game:GetService("RunService").RenderStepped:Connect(function()
		for i, Accessory in character:GetChildren() do
			if Accessory:IsA("Accessory") then
				if Accessory.AccessoryType == Enum.AccessoryType.Face or Accessory.AccessoryType == Enum.AccessoryType.Hat or Accessory.AccessoryType == Enum.AccessoryType.Hair then
					if (character.Head.CFrame.Position - workspace.CurrentCamera.CFrame.Position).Magnitude < 6 then
						Accessory.Handle.LocalTransparencyModifier = 1
					else
						Accessory.Handle.LocalTransparencyModifier = 0
					end
				end
			end
		end
	end)
end)

If your avatar still obscures your view maybe relax a bit with the accessories

1 Like

YESS, this is really helpful thank you :))

Great addition! I always wanted a “native” VR implementation rather than relying on NexusVR, mostly because i want to keep my game as custom as possible without using 3rd party modules or scripts.

However… Knowing that this just released, i also had some expectations when it comes to the implementation of it, considering the fact that its not a beta release.

Overall it works… Nothing crazy about it, but it has some important game-breaking bugs that need immediate attention. Moving on, i discovered a couple of issues as soon as i started using it in generic scenarios of the game, so those are not really “hard to reproduce” bugs.

Firstly, when using the “3rd person camera view” mode, as i get close to a wall, the character instantly moves on its own smashing into the part, becoming slightly uncontrollable.

Secondly, the first person mode has serios issues when it comes to teleporting. It takes significantly longer to move the avatar to the destination.

As soon as it change the view to third person, it gets back to normal.

Also the first person mode (and this is the craziest issue it has) refuses to work with simulated assemblies such as vehicles that have seats attached to it. In my case, testing the seat function makes the train jump and move like crazy, causing a massive derail, as if the player position forces the seat to move with it. I have not tested it yet with other simulated vehicles such as A-Chassis, but it might give similar results. (Also a funny thing, i get those white parts in my hands when the train despawns or when i get off a seat)

External Media

And lastly, the third person camera mode works with seats on assemblies, but as soon as i change the mode to first person view, it instantly throws me in all directions.

In conclusion, overall its ok… But i would have flagged it as a beta instead, because it cant be used in production like this…

6 Likes

Quick Question, are you able to support this for R6? i doubt it would, but would be cool to see.

will there be an option to hide the controller things? its nice and all but sometimes it might bother me

2 Likes

This is truly wonderful! I’m excited to test this out!
Out of curiosity, will we ever get support for turning our character based on where our head is facing?
Last I knew, when you turn your head it doesn’t mean you’ll move forward in the direction you’re looking, which can make it extremely easy to get disoriented if you like to turn with your body rather than the joystick.

What about using this in skinned meshes? (non r15 and non r6)

Yes, the controller models can be hidden; Nexus VR Character Model did it using this code (DefaultCursorService seems to be part of the module, so I commented it out):

--Disable the native VR controller models.
--Done in a pcall in case the SetCore is not registered or is removed.
task.spawn(function()
    for i = 1, 600 do
        local Worked = pcall(function()
            StarterGui:SetCore("VREnableControllerModels", false)
            -- DefaultCursorService:SetCursorState("Detect")
        end)
        if Worked then break end
        task.wait(0.1)
    end
end)

I’m getting the feeling that I’ve shown sometime else this code before and Nexus didn’t recommend using this code or something.

2 Likes

Add quest 3 controller model if on quest 3 and quest 2 controller model if on quest 2 please.

1 Like

:smile: This is gonna be awesome For VR Players Who Has Roblox In Vr only :slight_smile: