Experiencing delay or strange bouncing using my custom VR locomotion depending on where I bind on RenderStepped

  1. What do you want to achieve? Keep it simple and clear!
    I am porting Gorilla Tag’s locomotion 1:1 to Roblox. The locomotion is open source and I have reimplemented it (my code at the bottom of the post), but I am experiencing issues with how I use the spherecasts
  2. What is the issue? Include screenshots / videos if possible!
    Binding the locomotion to render priority 199 and below (before camera, after input) results in a strange delay in the hand followers.
    (Watch 2024-08-30 16-54-10 | Streamable)
    The locomotion works partly off of the cubes that are falling behind (which they shouldnt fall behind at all), adn when they fall very far behind it accumulates a ton of velocity and stops functioning all together.
    Moving the render priority after the camera (200+) causes a strange bouncing behavior.
    (Watch 2024-08-30 17-01-50 | Streamable)

(note that the parts that rotate represent the controllers and follow them directly [functioning as intended], the ones that dont rotate are the ones that follow.)

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    The solutions I have tried are listed above (changing the render priority) and I have tried numerous solutions, too many to list. I’m lost on this and have tried so many dev hub articles.

Below is the Locomotion code (the first script, placed in startercharacterscripts), the code to update the controller positions (placed in StarterCharacterScripts) and a place file for anyone who would like to attempt to fix the issue directly. Any help is appreciated :pray:

[code redacted, was a locomotion system binded to renderstep, switched it to be bound to an event fired by the Hands script]

Hands

local VRService = game:GetService("VRService")

local LeftHandPart = workspace.Hands:WaitForChild("LeftHandController")

local RightHandPart = workspace.Hands:WaitForChild("RightHandController")


workspace.CurrentCamera.HeadScale = 2

game:GetService("RunService").RenderStepped:Connect(function()
	if game:GetService("VRService").VREnabled then
		local LeftHandOffset = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
		LeftHandOffset = LeftHandOffset.Rotation + LeftHandOffset.Position * workspace.CurrentCamera.HeadScale
		LeftHandPart.CFrame = workspace.CurrentCamera.CFrame * LeftHandOffset

		local RightHandOffset = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
		RightHandOffset = RightHandOffset.Rotation + RightHandOffset.Position * workspace.CurrentCamera.HeadScale
		RightHandPart.CFrame = workspace.CurrentCamera.CFrame * RightHandOffset
	end
end)

Place File
please note when testing you should press the button that shows up on the gui to force the player to sit (stops the air drag)

monke.rbxl (284.7 KB)

2 Likes

Try using BindToRenderStepped for the second script as well. I think it’s possible that it’s firing after the physics script’s connection is fired.

If that doesn’t work, I would try connecting the loco function to a BindableEvent fired by the hands (second) script after it finishes repositioning the hands instead.

(I do not have a VR setup so I can’t test this at the moment, but hopefully this works :P)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.