#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)

tropic estuary
#

Help me please i want to retain scripting information but i forget and have to relearn again

#

a friend said if i want to make something i have to explain it in better words

#

im starting out on the run

sharp cove
#

ok. what do you have now?

tropic estuary
#

i have the animation

#

@sharp cove

sharp cove
#

what are you trying to do with the animation?

sharp cove
tropic estuary
#

when they do in any direction the walkspeed increases

#

and a different animation play

sharp cove
#

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?

tropic estuary
#

i want to learn

#

yes

sharp cove
#
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

sharp cove
#

@tropic estuary Does this solve your problem? Let me know if you need anything else.

tropic estuary
#

yeah

sharp cove
tropic estuary
#

ty

tropic estuary
#

i want to learn it

#

but every time i get somewhere i lose that point of progress

sharp cove
# tropic estuary how did you learn scripting

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.

tropic estuary
#

im on taht

#

@winged abyss

sharp cove
tropic estuary
#

ok

#

im making a movement system

#

i copied your code

#

is that good for my development

winged abyss
sharp cove
#

For anyone’s code, make sure not to blindly copy and paste but to actually understand it

tropic estuary
#

well

#

i do

#

i can explain it to you

tropic estuary
tropic estuary
#

@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

tropic estuary
#

@sharp cove

winged abyss
sharp cove
tropic estuary
#

nvm then

#

i'll figure it out

sharp cove
#

🛠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...

▶ Play video
tropic estuary
sharp cove
#

The video talks about how to link it and set it up too

tropic estuary
#

it won't stop with your code

sharp cove
#

Put that in the walk function

tropic estuary
#

i did

#

but it won't do the animation or speed up at all

tropic estuary
sharp cove
#

If speed up isn’t working check to see the animation is linked properly

tropic estuary
#

ok