How would you replace the vr hands in roblox with a desired union, mesh or brick

I wonder how you could make the VR hand controllers a part, union or mesh like for example to have a drumstick as the controller hands.

I would love if someone helped me out on this one question!

2 Likes

Sorry; i’m late.

Heres what I did (with a few things cut out since it was made for my game):

StarterGui = game:GetService('StarterGui')
VRService = game:GetService('VRService')
UIS = game:GetService('UserInputService')

if not VRService.VREnabled then return end -- don't let the code run if VR isn't enabled.
StarterGui:SetCore("TopbarEnabled", false)
StarterGui:SetCore("VRLaserPointerMode", 0)
StarterGui:SetCore("VREnableControllerModels", false)

local Left = script:WaitForChild('L')
Left.Parent = workspace.Camera
local Right = script:WaitForChild('R')
Right.Parent = workspace.Camera

HeadScale = 2
Cam = workspace.CurrentCamera
Cam.HeadScale = HeadScale
Cam.CameraType = Enum.CameraType.Scriptable
	
--Cam.CFrame = CFrame.new(0,50,0)
	
game:GetService('RunService').RenderStepped:Connect(function()
	local LC = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
	local RC = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
	Left.CFrame = (Cam.CFrame*CFrame.new(LC.p*2))*CFrame.fromEulerAnglesXYZ(LC:ToEulerAnglesXYZ())
	Right.CFrame = (Cam.CFrame*CFrame.new(RC.p*2))*CFrame.fromEulerAnglesXYZ(RC:ToEulerAnglesXYZ())
end)

Put this inside a localscript inside startergui. Also put two parts/meshparts/unions/ whatever named “L” and “R”.

You might have to change a few camera things, but this is the base of what I use.
Sorry for bumping this, I just wanted to help out lol

Edit: ALSO, This is local only! You have to use a remote in order to make this into a server script. Theres not a head included with this. You have to add your own code to make a head, which is pretty simple.

4 Likes

You should use the local keyword every time you declare a variable, it is faster that way.

http://www.lua.org/pil/4.2.html

Oh, yeah. Some of the code (the code where it says “Cam” and defines the top variables) wasn’t mine, but most of the time I use local (When I can, sometimes I don’t want to because I want to save a few lines of code; eg:)

function someFunction()
a = "a variable that can be put in a local variable but doesnt have to so it can save a line or two of code"
end

function someOtherFunction()
print(a)
end

etc.

Sometimes my code looks insane, like some parts were made by others because most the time they are but I don’t really credit them unless I’m making it open source because its useless and I don’t see the point in crediting people in a script only I’ll see.

Anyway, yeah.

I decided to mark infiniteRaymond as a solution, although I figured this out months ago,
It is still a solution, for anyone that comes across this in the near future!