#Guys im starting out and im making a game and the first thing i want to start out on is the movement
1 messages · Page 1 of 1 (latest)
a friend said if i want to make something i have to explain it in better words
im starting out on the run
ok. what do you have now?
what are you trying to do with the animation?
do you need help playing the animation with scripts?
get the player to hold shift
when they do in any direction the walkspeed increases
and a different animation play
Here's some pseudocode:
on input:
if shift key down
run
function run:
walkspeed = -- some number that denotes speed
do you need the actual code?
local userInputService = game:GetService('UserInputService')
local playersService = game:GetService('Players')
local thisPlayer = playersService.LocalPlayer
local character = thisPlayer.Character or thisPlayer.CharacterAdded:Wait()
local Humanoid = character:WaitForChild("Humanoid")
local running = false
local function walk()
Humanoid.WalkSpeed = 16
running = false
end
local function run()
Humanoid.WalkSpeed = 40 --Set this to your run speed
running = true
end
--detects when the input began
userInputService.InputBegan:Connect(function(input, GPE)
if GPE then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
run()
end
end)
--detects when the input ended
userInputService.InputEnded:Connect(function(input, GPE)
if GPE then return end
if input.KeyCode == Enum.KeyCode.LeftShift then
if running == true then
walk()
end
end
end)
I made this code a long time ago. Let me know if you need any explanations. Put this in StarterGui or StarterPlayerScripts
@tropic estuary Does this solve your problem? Let me know if you need anything else.
yeah
hey
where do i put this
You can put it in the StarterPlayerScript folder or in the StarterGui folder
ty
how did you learn scripting
i want to learn it
but every time i get somewhere i lose that point of progress
After doing a bit of coding it popped back to me. I’ve been working on a game for a while now and that gives me practice. Set a goal and work towards it. Dont be afraid to ask help from people or ai, and remember to do research.
how long do you practice
There’s really no length. There’s also not set goal, and the amount of time everyone takes is different. It all depends on the background.
ok
im making a movement system
i copied your code
is that good for my development
The Millennium Prize Problems are seven well-known complex mathematical problems selected by the Clay Mathematics Institute in 2000. The Clay Institute has pledged a US $1 million prize for the first correct solution to each problem.
The Clay Mathematics Institute officially designated the title Millennium Problem for the seven unsolved mathemat...
Do you understand it?
For anyone’s code, make sure not to blindly copy and paste but to actually understand it
no not really
well
i do
i can explain it to you
sorry if i don't respond im learning new things in animation
@sharp cove
help
i under stand all the vocab and what it does but how do i add animation
im using chat gpt
@sharp cove
@sharp cove
spamming pings aint going to help you out of that deep fryer, you're already cooked 💀
thx for backing me up mate holy smokes I wanted to spend some time with family T_T
oh....
nvm then
i'll figure it out
Check out this documentation: https://create.roblox.com/docs/reference/engine/classes/Animation
🛠If you're new to Roblox and want to start animating right away, then this is the video for you! In this tutorial, I'll teach you all the basics of animating in Roblox Studio so you can start creating your own scenes and animations! Thanks so much for watching, hope you guys have a great day! Subscribe 😎🛠
😎Subscribe: https://www.you...
the animation is already made
The video talks about how to link it and set it up too
how do i make it stop
it won't stop with your code
Use the Stop() function
https://create.roblox.com/docs/reference/engine/classes/AnimationTrack#Stop
Put that in the walk function
stop isn't working when i use it freeze the animation and won't let it play and the walkspeed won['t speed up
If speed up isn’t working check to see the animation is linked properly
ok