Okay, I’ll go straight to the point and say that I pretty much am trying to well “fix” an existing morph asset because well, the script is pretty much strange that and I am a beginner at this: 2D Morph Template Robot - Roblox
-
What do you want to achieve?
Have the animation of the morph itself start the instant a player moves and stop when the player stops moving. -
What is the issue?
To put it simple, it haves a small delay for the animation to actually start AND stop, I’ve been pulling my hair trying to think of a solution.
-
What solutions have you tried so far?
Looking further at the code I tried to change “while go” to “while running” but that would break the animation and I doubt other solutions I thought of would do anything, again, I am a complete beginner and this and some help would be really appreciated. <3
-- Config --
--------------------------
StandingID = "http://www.roblox.com/asset/?id=5707398901" -- Pic 1 IDLE
Walking1ID = "http://www.roblox.com/asset/?id=5707399015" -- Pic 2 Left Pose ,Start Cycle
Walking2ID = "http://www.roblox.com/asset/?id=5707399106" -- Pic 3 Right Pose, Between
Walking3ID = "http://www.roblox.com/asset/?id=5707399015" -- Pic 2 Left Pose, End Cycle
JumpingID = "http://www.roblox.com/asset/?id=5707399015" -- Pic 2 Left Pose
FallingID = "http://www.roblox.com/asset/?id=5707399015" -- Pic 2 Left Pose
--------------------------
-- Bools, Debounces, Tags --
running = true
jumping = false
betweencycle = false
local hum = script.Parent.Parent:FindFirstChild("Humanoid")
local pose = script.Parent:FindFirstChild("PoseBool")
local df = script.Parent.DecalFront
local db = script.Parent.DecalBack
local go = false
--------------------------
-- P.S Name the decal on the front, DecalFront and decal on back, DecalBack.
-- Functions --
function Move(speed)
if speed > 0 then
running = true
else
running = false
df.Texture = StandingID
db.Texture = StandingID
end
end
function Jumped()
df.Texture = Walking1ID
db.Texture = Walking1ID
jumping = false
wait(0.6)
jumping = false
df.Texture = Walking1ID
db.Texture = Walking1ID
end
function Fall()
if jumping == false then
df.Texture = Walking1ID
db.Texture = Walking1ID
end
end
hum.Running:connect(Move)
hum.Jumping:connect(Jumped)
hum.FreeFalling:connect(Fall)
--------------------------
if game.Players:FindFirstChild(script.Parent.Parent.Name) ~= nil then
go = true
end
-- Loop --
while go do
wait(0.15)
if running and pose.Value == false then
if df.Texture == StandingID then
df.Texture = Walking1ID
elseif df.Texture == Walking1ID then
df.Texture = Walking2ID
betweencycle = true
elseif df.Texture == Walking2ID and betweencycle then
df.Texture = Walking3ID
betweencycle = false
elseif df.Texture == Walking2ID and betweencycle == false then
df.Texture = Walking1ID
elseif df.Texture == Walking3ID then
df.Texture = Walking2ID
end
end
db.Texture = df.Texture
end