I’ve already searched far and wide across the internet about this but to no avail. The official skateboards don’t have any tricks and are super buggy. The skateboards in scripts are super obfuscated and I don’t understand a single thing. I just need help to animate a single skateboard trick (e.g. a kickflip). I’ve already tried before and it didn’t work. I’ve already tried using scripts to make the official skateboard models rotate.
Hey there!
You can achieve your goal by Creating an Animation
, add the Skateboard
to the Character
, add the Animation
to the Skateboard
, and lastly reigger the Animation!
It should look something like this
Example
local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")
local skateboard = backpack:WaitForChild("Skateboard")
local animation = skateboard:WaitForChild("KickflipAnimation")
local userInputService = game:GetService("UserInputService")
local isPlaying = false
userInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and not isPlaying then
isPlaying = true
animation:Play()
animation.Stopped:Wait()
isPlaying = false
end
end)
This script detects when the player presses the “Q” key and then plays the KickflipAnimation
on the skateboard. The isPlaying
variable is used to prevent the animation from being played multiple times at once.
I hope this helps you get started with animating skateboard tricks in Roblox!
Wait, is this for animating the board or the player avatar? I’m looking to animate the board.
Hey there!
The script provided will wait for an animation found inside of a skateboard, which will animate the Skateboard
do I have to rig the skateboard to the character while I make the animation? (before putting the script stuff in)
Yes, you will need to rig the skateboard to the character while creating the animation. This will ensure that the animation is correctly synced with the skateboard and looks smooth during gameplay.
I tried using the script and it still doesn’t work. So I tried to do a print and it still didn’t show up anything on the output. By the way, I’m using SkateboardPlatforms.
Hey there!
Make sure you have a working animation owned by you or your group. This will ensure that our animation is owned by us, and allows us to execute further actions.
In case that didn’t work, we can add some debug statements
Example
local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")
local skateboardPlatform = backpack:WaitForChild("SkateboardPlatform")
local skateboard = skateboardPlatform:FindFirstChildOfClass("Skateboard")
local animation = skateboard:WaitForChild("KickflipAnimation")
local userInputService = game:GetService("UserInputService")
local isPlaying = false
userInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and not isPlaying then
isPlaying = true
print("Starting animation")
animation:Play()
animation.Stopped:Wait()
print("Animation stopped")
isPlaying = false
end
end)
wait hold on I think I got it I’ll edit when I’ve got it
nevermind still no output
Is this a localscript, or a script? And where is this placed
it’s a LocalScript and it’s placed inside of the SkateboardPlatform, the animation is placed inside of the Skateboard LocalScrpt
Are all the names correct? Animation for kickflip should be named KickflipAnimation
, etc
yeah I’ve double-checked the name of it both within the script and the animation name itself and it’s correct
Assuming that (SkateboardPlatform) is in your inventory, (Skateboard) inside of the platform, and (KickflipAnimation) inside of the Skateboard, I wouldn’t recommend the continuous usage of SkateboardPlatform
as it’d deprecated.
Feel free to move over using a VehicleSeat
and making changes as followed.
Vehicle Seat Example
local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")
local vehicleSeat = backpack:WaitForChild("VehicleSeat")
local animation = vehicleSeat:WaitForChild("KickflipAnimation")
local userInputService = game:GetService("UserInputService")
local isPlaying = false
userInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q and not isPlaying then
isPlaying = true
print("Starting animation")
animation:Play()
animation.Stopped:Wait()
print("Animation stopped")
isPlaying = false
end
end)
The InputBegan
should always fire whenever the key (“Q”) is pressed, and play the animation.
nevermind found a script for it