Hello!
I’ve been working on my game and I’m tyring to implement a system where;
if the player lands, an animation plays.
I have no idea how to do this, as I am a new scripter.
(I am not looking for full scripts, only scripts that tell me when the player has landed)
Any help is appreciated!
3 Likes
you could detect when the Humanoid state changes or when their Y velocity changes from - to 0 or positive
Check if Humanoid.FloorMaterial ~= “Air”
Humanoid.FreeFalling:Connect(function(active)
if active then
-- Falling
else
-- Landed
end
end)
2 Likes
I was asleep. I will try all of these
That would just make it infinitely play.
Yay, this works. It plays even when the smallest of jumps, but its still something.
nicemike40
(nicemike40)
November 1, 2022, 12:59pm
#8
You can use @Vikram200526 ’s idea with a small tweak
Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
if Humanoid.FloorMaterial ~= Enum.Material.Air then
print("Landed")
end
end)
I said this wouldnt work. It prints “Landed” when I change a material. Such as changing from diamond plate to metal.
nicemike40
(nicemike40)
November 1, 2022, 1:05pm
#10
Oh true my bad, here’s the fix for that. But if FreeFalling works that does seem simpler
local lastMaterial = Humanoid.FloorMaterial
Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
local mat = Humanoid.FloorMaterial
if mat ~= Enum.Material.Air and lastMaterial == Enum.Material.Air then
print("Landed")
end
lastMaterial = mat
end)
2 Likes
This also works. I would mark this as solution if I could mark 2 solutions.
1 Like
That was what i mean by using humanoid.FloorMaterial i just didnt have the time to write a script, just gave an idea xd
system
(system)
Closed
November 15, 2022, 2:43pm
#13
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.