#Why won't this procedural animation work when it's a StarterCharacter?
1 messages · Page 1 of 1 (latest)
why you are doing 2 loop instead of one and you are not updating the position of the part (the blue part) that the IK is attached to
it was on a tutorial
the blue part is being updated in a module script
do you have any error in your output?
nope
except for Infinite yield possible on 'Workspace.[user]:WaitForChild("Torso")'
does it have to do with anything localscript/serverscript?
try fixing that
uh ok
it doesnt lead to a script
look at the number next to it
go to that line
no script
again
when i click it it does nothing
oh it didnt appear this time
nvm it did
ye cus startercharacterscriot copies over the script to a character so when u stop the game that script gets deleted so when u click on it in the output it goes nowhere. js go to the same line in the script it said to
To sum it up
Infinite yield is like
It can’t find it
So maybe the torso has a lowercase?
It’s case sensitive so you gotta fix it if there is any mistakes
If not then is it in the right path?
So then isn’t it that?
Then why is there a warning
I see
I’ll take a look in a sec just let me get my computer up
k
Your legs don’t move because inside your IkLegStep function you overwrite the step settings
what.
bruh
but it works with the npc?
im new to scripting
oh i see
sorry ill summerize it
It works on NPCs but not when you play because the raycast is hitting your own character instead of the ground. Add your character to the raycast ignore list so the raycast can see the floor
is that good?
So maybe change this
rayCastParams.FilterDescendantsInstances = {enemy}
with this
rayCastParams.FilterDescendantsInstances = {enemy, game.Players.LocalPlayer.Character}
tell me if it works
k
didnt work
the issue is
that the script isnt starting up
cuz the squares are supposed to go invis
but they dont
its prob smt with the modulescript
or the script can't call iklegstep()
one of the two
i just dk how to fix it
ohh i see the problem lol
Your script never starts because require() cannot find your module
Replace /moduleLocation/.ProceduralModule with the actual location of the ModuleScript
because module isnt really a thing
sorry moduleLocation
isnt a thing
like script.Parent.Module or wherever it is in your game
** You are now Level 2! **
oh ok
tell me what happens
should be right yeah
nope
local ProceduralModule = require(game.ReplicatedStorage.ProceduralModule)
nothing
the script itself runs it
at the end
while true do
ProceduralModule:IkLegStep(leftFront_IkTarget, leftFront_RaycastPart, enemy.PrimaryPart, 2, 2, 1, 0.05, rayCastParams)
task.wait(0.1)
ProceduralModule:IkLegStep(rightBack_IkTarget, rightBack_RaycastPart, enemy.PrimaryPart, 2, 2, 1, 0.05, rayCastParams)
task.wait(0.1)
ProceduralModule:IkLegStep(rightFront_IkTarget, rightFront_RaycastPart, enemy.PrimaryPart, 2, 2, 1, 0.05, rayCastParams)
task.wait(0.1)
ProceduralModule:IkLegStep(leftBack_IkTarget, leftBack_RaycastPart, enemy.PrimaryPart, 2, 2, 1, 0.05, rayCastParams)
task.wait(0.1)
end
IkLegStep() is defined in the module
hmm give me a sec ill check the script out again
yeah
and the script in the startercharacter is a script
thats the module
okay ill need both if there is two scripts
thats IN the module
yes
script
module
oops i didnt see that one
maybe its the way you defined/named them
The code is looking for LeftFront, LeftBack, RightFront, and RightBack
well its the exact same as the npcs
oh wait thats wrong
wait no it isnt
so confusing
yes its very confusing
i think it is the way you defined it
just try it
maybe like this
local leftFront_IkTarget = ikTargets:FindFirstChild("LeftFront")
local leftBack_IkTarget = ikTargets:FindFirstChild("LeftBack")
local rightFront_IkTarget = ikTargets:FindFirstChild("RightFront")
local rightBack_IkTarget = ikTargets:FindFirstChild("RightBack")
The part name in the workspace must still match the string inside FindFirstChild()
yeah
why not table
?
cuz tutorial
you copied the tutorial wrong
yeah then they made a mistake maybe
** You are now Level 3! **
actually
ppl in the comments were saying
that it wasnt working with startercharacter
my solution for right now is that
yeah so
you probably just need to define them right
Your model uses 6 legs
but the script is written for 4 legs
It’s looking for LeftFront LeftBack RightFront RightBack
lol for real?
lol
dont make fun of me im doing my best to help this guy
what not at all, that's hilarious
they took some random tutorial's code, then started changing parts of it without changing any of the code assuming it could magically read their mind and do the new thing
like taking a humanoid, adding legs to it and asking "Why isn't it changing to a quadruped? I added extra legs!!" 
yeah so he probably either has to rename the stuff or just code it entirely for 6 legs
you gotta do a lot more than just rename stuff if you want to turn 4 legs into 6
the walk cycle would be completely different
i mean you could sit here and give them the code for 6 legs but here's to betting if they thought it could automagically change the walk cycle they have no clue how to adjust the code
obviously i wont code for 6 legs
i shouldnt really waste my time
maybe some advice for him is good
local leftFront_IkTarget = need(ikTargets, "LeftFront")
local leftMiddle_IkTarget = need(ikTargets, "LeftMiddle")
local leftBack_IkTarget = need(ikTargets, "LeftBack")
local rightFront_IkTarget = need(ikTargets, "RightFront")
local rightMiddle_IkTarget = need(ikTargets, "RightMiddle")
local rightBack_IkTarget = need(ikTargets, "RightBack")
just define it like that and go from there
** You are now Level 4! **
its bad advice but literally what am i supposed to do
you seem new here
4
yeah ive been coding for a long time
i can debug my own code 100%
but uh others are just hard
bah, it's not that. you new to roblox dev?
you mean the server?
i mean to roblox
or literally being a roblox dev
oh no ive been a roblox dev for a while
just only by myself with a few friends maybe
but ive only been the only coder
so no roblox dev guilds i take it
no
okay then yeah that explains it 
hope thats not a bad thing
nah not at all
just says that you haven't yet figured out to bear in mind the roblox demographic
roblox targets young audience, and when kids see games like steal a brainrot and grow a garden and how simple they seem on the surface they think they can create it in a day with zero experience
i dont know man
it's that point where ai can code anything and games are made in a day
not true of course but they don't know that
also about this
do you got any advice?
yeah the solution is to learn from the tutorial instead of copy+pasting it and expecting it to read your mind when you change things about it
yo
it said "either download the model or make your own system"
so uh...
yeah
im out for this sorry
gg
** You are now Level 13! **
so i assume
that
i cant fix it
well someone who knew what they were doing could fix it. but if you don't know what you're doing then yeah you either can't fix it or you're going to have a very hard time fixing it
you'd need a whole host of debugging skills which you don't seem to have
if you did you probably wouldn't be asking just broadly "it no worky, why not
"
you'd instead be saying you tried X, Y, and Z and can't trace the bug
you'd also have a very clear explanation of what's wrong with it
-- but see if you could do those 2 things, you'd probably be able to fix it on your own
i know nothing beyond basics of lua
inverse kinematics is not for beginners
yeah but
i'd almost wager you don't actually understand what it is this tutorial is showing you
spider robot
yeah
you just glazed over at the sight of a spider robot and said i want
like a baby reaching for candy they can't have
do you even understand what ik is
from what i understand
its where it makes bones do physics stuff
and rotate/move
to try to connect point A and point B
animations makes bones do physics stuff and rotate/move and connect point a and point b too, what's the difference?
well you're not wrong i can say that much
I've used IK in animations before
-just not gameplay
wait
so am I screwed
or is there still hope
yea you can't just throw a humanoid on that and expect it to work
animate.lua is also not built for it
you need to do extra work if you want a player to control this
PlayerModule can't handle it either
which is roblox's default player controls script which handles movement inputs
you'd have to effectively make your own input handler
so movement inputs translate to sane outputs by the ik solver and movement of the body in general
and....
i have no idea how to do that
so its just not gonna work
and i wasted my day
is that a yes
or a no
an unsuccessful result is not waste
you most certainly learned something along the way, that's what counts
in fact going into any coding exercise expecting to get it perfect and correct on your first try is naive at best and utterly delusional at worst.
some problems take longer than a day, that's one thing you have learned 👍
uhhh so what do i gotta do
cuz this is for a game me n my friends are working on
and i cant just scrap the whole thing
well, for starters, lots and lots of googling and learning things
second, well, debugging is ubiquitous and is the same for all coding
ok
ill let u know what i've gotten tmr
as if i dont have anything better to do lol