Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My NPC is not animated in my game :c ?

Asked by 5 years ago

So , i created a Baseplate to test all my NPC and it was working perfecly , they were moving , they were animated ... But when i exported my NPC in my Really Game where i have all my work , They move correcly but they are no animated ... When they walk you dont see the leg move ... Its very strange because in the baseplate it was working .. So i dont know ho to fix that so if u knwo help me :c . THe NPC is animated by a "Animate" script and i use this script for moving it :

Code :

local CurrentPart = nil

local MaxInc = script.Parent.Configuration["Walk Level [Read the Read me before Changing!]"].Value



function onTouched(hit)

if hit.Parent == nil then

return

end



local humanoid = hit.Parent:findFirstChild("Humanoid")



if humanoid == nil then

CurrentPart = hit

end

end



function waitForChild(parent, childName)

local child = parent:findFirstChild(childName)



if child then

return child

end



while true do

print(childName)



child = parent.ChildAdded:wait()



if child.Name==childName then

return child

end

end

end



local Figure = script.Parent

local Humanoid = waitForChild(Figure, "Humanoid")

local Torso = waitForChild(Figure, "Torso")

local Left = waitForChild(Figure, "Left Leg")

local Right = waitForChild(Figure, "Right Leg")



Humanoid.Jump = true



Left.Touched:connect(onTouched)

Right.Touched:connect(onTouched)



while true do

wait(math.random(0, 5))

wait()

if CurrentPart ~= nil then

if math.random(1, 2) == 1 then

if (script.Parent.Configuration["Jump at random times"].Value == true) then

Humanoid.Jump = true

end

end



Humanoid:MoveTo(Torso.Position + Vector3.new(math.random(-MaxInc, MaxInc), 0, math.random(-MaxInc, MaxInc)), CurrentPart)

end

end
0
Are there any services not enabled in the main game that are enabled in the baseplate (or vice versa)? GamingZacharyC 152 — 5y

1 answer

Log in to vote
0
Answered by
tomekcz 174
5 years ago

If this is somebody animation it will work in roblox studio but not in game! sad

Ad

Answer this question