Hello, what would be the best way to make a sliding animation like the one in bad buisness?
There are a lot of ways to do this. My preferred method for sliding doors is TweenService, which allows you to animate your doors in a lot of different styles.
Some things to note about TweenService:
-
Tweens can look choppy on the server if you make them go long distances in short periods of time. Usually, this isn’t noticeable for regular doors.
-
If you want to make it look as smooth as possible, it’s probably best to let the client handle the tweening while the server activates it with a remote event.
-
TweenService is good for animating things like doors, but there are some things that you wouldn’t want to use it for, such as elevators.
I was actually looking for a player animation so when the game detects the player pessing shift, w and c then the crouch animation will be turned off and the player will be able to slide until the player takes their hand off of one of the keys
Oh, haha. Sorry about that. I misunderstood. Wasn’t sure since I haven’t played the game you put in the post.
do you know how i could go about doing this?
You could use UserInputService’s InputBegan event in combination with the IsKeyDown function. I did something similar for a copy and paste detector a while back. You could check for when they press one of the keys, and then see if the other two are down. Then, you could use Humanoid:LoadAnimation() to load and play the animation.
Here is my code for combining the keys but its not working, can you please help?
if key.KeyCode == Enum.KeyCode.W and key.KeyCode == Enum.KeyCode.LeftShift and key.KeyCode == Enum.KeyCode.C then
print('play')
animationTrack3:Play()
wait(0.17)
animationTrack3:AdjustSpeed(0)
end
end)
UserInputService.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.W and key.KeyCode == Enum.KeyCode.LeftShift and key.KeyCode == Enum.KeyCode.C then
animationTrack3:Stop()
end
end)```
Is there anything else above your first if statement?