When running an animation, the offset goes up and does not come down

I’m making a now-defunct game called Rolling Sky on Roblox. But the jump platform works strangely. I’ve already searched for similar issues on the dev forums, but I haven’t found anyone experiencing the same issue as me, and I hope this bug is fixed.

Beta Features :
:black_small_square:︎Avatar Joint Upgrade
:black_small_square:︎Dragger QoL Improvements
:black_small_square:︎Gamepad Emulator
:black_small_square:︎Import Queue
:black_small_square:︎Improved Constraint Tool
:black_small_square:︎Improved Mass Properties
:black_small_square:︎Live Animation Creator
:black_small_square:︎New Luau type solver
:black_small_square:︎Occlusion Culling
:black_small_square:︎Preferred Text Size Setting
:black_small_square:︎Script Sync [Early Preview]
:black_small_square:︎Studio soild modeling improvement
:black_small_square:︎Texture Generator
:black_small_square:︎UIDragDetectors
:black_small_square:︎Unified Lighting
:black_small_square:︎Updated Roblox Controls
:black_small_square:︎VR Emulator

in Game

in Editor

local model = script.model.Value

while model == nil do
	task.wait()
	model = script.model.Value
	print("model")
end

local cha = game.Players.LocalPlayer.Character

local u = cha.Humanoid.Animator:LoadAnimation(model.Upping)

model.c.Changed:Connect(function(val)
	if val == true then
		if u.IsPlaying == false then
			u:Play()
			u:AdjustSpeed(0.1)
			local bv = Instance.new("BodyVelocity")
			bv.Parent = cha.HumanoidRootPart
			bv.Velocity = Vector3.new(0, 0, 0)
			bv.MaxForce = Vector3.new(0, math.huge, 0)
		end
	end
end)

model.t.Changed:Connect(function(val)
	if val == true then
		if cha.HumanoidRootPart:FindFirstChild("BodyVelocity") then
			cha.HumanoidRootPart.BodyVelocity.MaxForce = Vector3.new(0, 0, 0)
			cha.HumanoidRootPart.BodyVelocity:Destroy()
		end
		u.TimePosition = 0.999
		u:AdjustSpeed(0)
		task.wait()
		u.TimePosition = 0.999
		u:AdjustSpeed(0)
		u:Stop()
	end
end)

game:GetService("RunService").RenderStepped:Connect(function()
	model = script.model.Value
	if model.t.Value == false then
		if cha ~= nil then
			if model.c.Value == false then
				if (Vector3.new(cha.HumanoidRootPart.Position.X, cha.HumanoidRootPart.Position.Y, model.JumpPad.Position.Z + -4) - cha.HumanoidRootPart.Position).Magnitude < 4 then
					model.h.Value = true
				end
			end
		end
		if model.h.Value == true then
			if model.c.Value == false then
				model.c.Value = true
				model.JumpPad.Transparency = 0
				model.JumpPadOff.Transparency = 1
			end
			local magnitude = (1+(-(Vector3.new(cha.HumanoidRootPart.Position.X, cha.HumanoidRootPart.Position.Y, model.JumpPad.Position.Z - 20) - cha.HumanoidRootPart.Position).Magnitude)/20)
			u.TimePosition = magnitude
			print(magnitude * u.Length)
			u:AdjustSpeed(0.01)
			u:AdjustWeight(1)
			if magnitude > 0.96 then
				print("mag2")
				model.t.Value = true
			end
		end
	end
end)

Above is the jump platform script. It is a local script, and its parent is a server script, and the server script is a system that copies the local script and inserts it into the player.

local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

local player = script.Parent:WaitForChild("HumanoidRootPart")
local moveSpeed = 0.2
local stopThreshold = 0.5

local targetXPosition = player.Position.X

game:GetService("GuiService").TouchControlsEnabled = false

task.wait(10)
script.Parent.Spawn:FireServer() -- game start

RunService.RenderStepped:Connect(function(deltaTime)
	local mousePosition = UserInputService:GetMouseLocation()
	local viewportSize = workspace.CurrentCamera.ViewportSize
	local normalizedX = (mousePosition.X / viewportSize.X) * 2 - 1
	targetXPosition = normalizedX * 65
	
	local currentX = player.Position.X
	local distance = math.abs(targetXPosition - currentX)
	local newX = currentX + (targetXPosition - currentX) * moveSpeed
	if script.Parent.Die.Value == true then
		player.Position = Vector3.new(player.Position.X, player.Position.Y, player.Position.Z - ((script.Parent.Speed.Value * 60)*deltaTime))
		player.Parent:WaitForChild("Head").Position = Vector3.new(player.Parent:WaitForChild("Head").Position.X, player.Parent:WaitForChild("Head").Position.Y, player.Parent:WaitForChild("Head").Position.Z - ((script.Parent.Speed.Value * 60)*deltaTime))
	else
		player.Position = Vector3.new(newX, player.Position.Y, player.Position.Z - ((script.Parent.Speed.Value * 60)*deltaTime))
		player.Parent:WaitForChild("Head").Position = Vector3.new(newX, player.Parent:WaitForChild("Head").Position.Y, player.Parent:WaitForChild("Head").Position.Z - ((script.Parent.Speed.Value * 60)*deltaTime))
	end
end)

Above is the player movement script, which is also a local script and is included in StarterCharacterScripts.

Expected behavior

I hope the animation works properly.

1 Like

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue, and will come back as soon as we have updates!

Thanks for flagging!

Hi, thanks for your report!
Would you mind telling us a little more about the issue you’re seeing ?

What are you trying to accomplish, what are you using to accomplish that, and in what way what you’re trying to accomplish is not working ?

Thanks,
NotARobloxEngineer