Issue with client-side anchoring and network ownership

I am trying to make a vaulting mechanic for a movement system I am working on. After a series of raycasts verifying and plotting a vault over an obstacle, the script uses a tween to glide the player over the obstacle.

The issue is, tweening the character’s rootpart doesn’t work because its position gets overridden by the characterController. One way I’ve found to get this to work is to anchor the root part, but that presents another issue: Anchoring a network owned part on the client will revert its network ownership back to the server.

Does anybody know another way around this? I could potentially disable the controller for the duration of the vault, but I dont know how physics would affect the vaulting process since the root is no longer anchored

1 Like

have you tried set humanoid state to Ragdoll or PlatformStand ?

1 Like

There is no humanoid, this is a custom character system using roblox’s ControllerManager object

Are you saying the character controller is tweening the character’s position?
Tell the character controller to vault then.

1 Like

the character controller moves the character by whatever means roblox has it set to move the player. It is built into roblox, I do not know how they have it set up. As far as I am aware, the character controller does not have a tweening option

1 Like

Try running this real quick on the client (Char is the character):

local RS = game:GetService("RunService")
local HRP = Char.HumanoidRootPart
local Override = nil
RS.RenderStepped:Connect(function(dt)
	if Override then
		HRP.CFrame = Override
	end
end)

while task.wait(1) do
	Override = HRP.CFrame
	task.wait(1)
	Override = nil
end

pretty jittery, but it does affect movement. The character holds in place, slowly moving downward by gravity until override is removed

Try the same thing with Heartbeat instead of RenderStepped. (According to RunService, Heartbeat runs last in the frame sequence)

If the character holds perfectly still then you know that Roblox is running their CFrame changes before the Heartbeat event. Essentially, every frame Roblox will run through a sequence of events yielding the connected functions (outside of thread yields of course). And then it will visually render the frame. All you need to do is run your CFrame changes after their changes.

insert a body mover inside root part with force of 0 on all axis, it will act as anchor

I ended up instead just disabling collisions on the root part and using alignPosition and alignOrientation to get it to do what i wanted it to do. Thank you for your help though!