VR Movement & Rotation

Before I begin I just want to state the device I’m using which is the Oculus Quest 2.

Currently I have been learning how to make VR mechanics on Studio and I came into a problem I still haven’t figured out completely

My issue is that I don’t know how to implement Movement & Turning / Rotation.

I have already looked for solutions on other posts on how to add movement, but all the methods I had tried haven’t worked so far, it could be due to my code being incompatible with them.

Some of the posts I have tried:
https://devforum.roblox.com/t/how-could-i-make-simple-vr-movement/950795/2
https://devforum.roblox.com/t/how-would-i-make-a-vr-movement-system/979582

My problems with these 2 posts is that when I implement the code from them and edit it so it works with mine, it just ends up with the camera moving on the Y Axis & moving my head around in VR while doing that creates a very distorted effect.

Another problem I encountered is when I press the Right Analog Button down I go into first person and im not sure how to disable that either.

I have already implemented features like Server-Side support, Hands, Head, Etc.
I’m not sure if that affects the chunk of code that does the movement from working, if anyone has a good solution please reply, if you need anything else ill get it, such as sampling code bits.

Thank you for reading my post.

3 Likes

To get rid of the problem of going into first person when pressing the right analog button you’ll have to use this:

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

The way I make VR Locomotion is I create a custom character for every player. The custom character includes a 1.5 by 1.5 by 1.5 stud ball. Make the ball unanchored with CanCollide on. Then use RunService.RenderStepped and make the Camera CFrame however many studs you want above the ball. Once that is set up you can move onto VR Movement. I insert a BodyVelocity into the ball. And do

local VRSpeed = 10
UserInputService.InputChanged:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Thumbstick1 then
		HumanoidRootPartBodyVelocity.Velocity = ((CurrentCamera:GetRenderCFrame().RightVector * (Input.Position.X * (VRSpeed.Value))) + (CurrentCamera:GetRenderCFrame().LookVector * (Input.Position.Y * (VRSpeed.Value/0.75))))
    end
end)

You can also just use my VR System which is Opensourced and can allow you to climb:

9 Likes

Thank you, have a nice rest of your day.

3 Likes