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
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
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
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.
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!