#Animation for platformstand
1 messages · Page 1 of 1 (latest)
hum.StateChanged:Connect(function(oldST, newST)
if newST == Enum.HumanoidStateType.PlatformStanding then
loadedAnim:Play()
startBouncing()
else
loadedAnim:Stop()
stopBouncing()
end
if newST ~= Enum.HumanoidStateType.PlatformStanding and player.CharacterAdded and bouncing then
if char == nil then return end
if HRP == nil then return end
local currentvelocity = HRP.AssemblyLinearVelocity
local Xvel = currentvelocity.X
local Zvel = currentvelocity.Z
local Yvel = currentvelocity.Y
HRP.AssemblyLinearVelocity = Vector3.new(Xvel, -1000, Zvel)
bouncing:Disconnect()
bouncing = nil
end
end)
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local camera = workspace.CurrentCamera
local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local HRP = char:FindFirstChild("HumanoidRootPart")
local InputService = game:GetService("UserInputService")
local animator = hum:WaitForChild("Animator")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://123629161073961"
local loadedAnim = animator:LoadAnimation(anim)
loadedAnim.Priority = Enum.AnimationPriority.Action3
loadedAnim.Looped = true
local bouncing = nil
local bounceCooldown = false
local BOUNCE_POWER = 85
local BOUNCE_MULTIPLIER = 1.15
local MAX_SPEED = 220
local RAY_DISTANCE_EXTRA = 4
local COOLDOWN_TIME = 0.08
local rayParams = RaycastParams.new()
rayParams.FilterType = Enum.RaycastFilterType.Exclude
rayParams.FilterDescendantsInstances = {char}
local currentPower = BOUNCE_POWER
those are the parameters
y velocity at -1000 is a little aggressive
add fade times. use :Play() and :Stop()
put the StateChanged/PlatformStanding connection after humanoid, animator, and platformStandTrack exist