I am using Align Position And attachments, to do grabbing in roblox vr, but it seems align positions, attachments and align orientations have a delay, that is very visible, I’ve seen other roblox vr games, use attachments and aligning position and orientation, and they have no delay at all!
function GripGoRight()
if workspace:FindFirstChild("GrippedRight") ~= nil then
workspace.GrippedRight.AlignOrientation.Attachment1 = nil
workspace.GrippedRight.AlignPosition.Attachment1 = nil
workspace.GrippedRight.Parent = workspace.ThingsInHere
end
end
function GripGrabRight()
local TheKids = workspace.ThingsInHere:GetChildren()
local DistanceRight = 1
for i = 1,#TheKids do
if (TheKids[i].Attachment.WorldPosition - workspace.Johna.Position).magnitude<DistanceRight and TheKids[i].AlignOrientation.Attachment1 == nil then
GripGoRight()
DistanceRight = (TheKids[i].Attachment.WorldPosition - workspace.Johna.Position).magnitude
TheKids[i].AlignOrientation.Attachment1 = workspace.Johna.Attachment
TheKids[i].AlignPosition.Attachment1 = workspace.Johna.Attachment
TheKids[i].Name = "GrippedRight"
TheKids[i].Parent = workspace
end
end
end
Thats the script for right hand grabbing, ( The kids Refers to the object that the player is trying to pick up )
Johna refers to the righthand, and for the left hand its jenna
Its the same script for left hand, but you change stuff like johna to jenna and GripGrabRight to GripGrabLeft!