Align position is shaking in VR

Hi, im not sure if this is the correct topic to post this but im making a VR game and I want to implement physics to the hands but they act all weird.

it happens when I move or push something.

note: this is my first time working with VR so thats why everything looks bad.

Example of pushing objects:

anyways thanks for reading.

2 Likes

code please? it will help us to analysis the issue better. thanks

Here is the code

the arms are cloned in to the character by a serverscript

local VRService = game:GetService("VRService")
local Workspace = game:GetService("Workspace")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")

local HeadScale = 1

local Camera = Workspace.CurrentCamera

local Player = Players.LocalPlayer

local Character = Player.CharacterAdded:Wait()

wait(0.2)

local LHand = Character:WaitForChild("LArm")
local RHand = Character:WaitForChild("RArm")

wait(1)

if not VRService.VREnabled then
	script:Destroy()
end

Character.Humanoid.Parent = game.Lighting

LHand.CanCollide = true
RHand.CanCollide = true

game.Lighting.Humanoid.Parent = Character

Camera.HeadScale = HeadScale
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = Character:WaitForChild("Head")

RunService.RenderStepped:Connect(function()
	local HandSize = RHand.Size
	local HandOffset = CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0) * CFrame.new(0, HandSize.Y / 3, 0)
	
	local UnCalcRHandCFrame = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
	local UnCalcLHandCFrame = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
	
	local RHandCFrame = (Camera.CFrame*CFrame.new(UnCalcRHandCFrame.p*HeadScale))*CFrame.fromEulerAnglesXYZ(UnCalcRHandCFrame:ToEulerAnglesXYZ())
	local LHandCFrame = (Camera.CFrame*CFrame.new(UnCalcLHandCFrame.p*HeadScale))*CFrame.fromEulerAnglesXYZ(UnCalcLHandCFrame:ToEulerAnglesXYZ())
	
	Camera.CFrame = Character.Head.CFrame
	
	RHand.AlignPosition.Attachment1.WorldCFrame = RHandCFrame
	RHand.AlignOrientation.Attachment1.WorldCFrame = RHandCFrame
	LHand.AlignPosition.Attachment1.WorldCFrame = LHandCFrame
	LHand.AlignOrientation.Attachment1.WorldCFrame = LHandCFrame
end)
1 Like

you can prob add a tween to smooth the movement so it wont look too shaky

i can try that but when pushing an object wouldnt that just slow down the shaking and cause a delay in movement?

maybe try to increase the hand’s mass? to give it more weight and make it less susceptible to jitter

okay ill try that

30 letter limit

nope it dint work nothing changed ):

Update: i have fixed the object pushing issue by making the attachments that track the controllers be parented to an anchored part. Idk how that fixed the pushing issue but it did.

Only thing is when moving the arms still have a little delay and still shake.

1 Like

reacting so i make this topic active again

If you increase the responsiveness of the AlignPosition, it should react faster to your movement, making the shaking less visible.

the responsiveness is set to 200 (the max)

Maybe don’t use align position then, and instead just set the cframe of the hands every frame? Preferrably using RunService:BindToStep()? I made a VR game before, I forgot what method I used.

the problem with not using align position is that the hands dont have physics like stop when they touch a wall unless there is a way to work around that.

i did see someone use align position and not have this issue but i cant find how they did it

You’re right, didn’t think of that. I noticed that the CoreGui screen is also shaking, so maybe this is a roblox bug?

yea it could be a roblox bug but its unlikely because the CoreGui also shakes when testing the vr sandbox place and the hands dont shake there. Its brobably just my bad code but i cant find what is wrong with it

Have you tried testing different materials for the arms? Some are heavier than others.

Yea i did but it does bassicaly nothing because the maxforce of the align position is high else they will fall on the ground or have a delay.

But i think it is a script issue because i tried my way of tracking the hands in the vr sandbox and that caused the issue to happen there too.

The shakiness can be fixed by reducing your hands’ density to a minimum.

I set it to the minimum (0.01) but that changed nothing.