As the title says, I think it’s obvious, when the animation finishes, make the 6D engines look like the animation ends, I want to do it through code, please help me, I’m waiting for a response
I don’t know if anyone wants to help me but just in case this is the code I tried but the different positions remain:
Balanceo = false
Right = true
local Tabla = {}
for i , V in pairs(Char:GetDescendants()) do
if V:IsA("Motor6D") then
Tabla[V.Name] = V.Transform
end
end
print(Tabla)
Animation:Stop()
for i,V in pairs(Char:GetDescendants()) do
if V:IsA("Motor6D") then
print(V.Name)
if Tabla[V.Name] then
V.Transform = CFrame.new(0,0,0)
V.Transform = Tabla[V.Name]
end
end
end
Help me please, help me please for please help me i need You help
You want the Motor6D’s to return to their original positions after an animation finishes?
-- Assuming Char is your character model and Animation is your animation track
local initialMotor6DTransforms = {}
-- Store initial transforms of all Motor6D components
for _, motor in pairs(Char:GetDescendants()) do
if motor:IsA("Motor6D") then
initialMotor6DTransforms[motor.Name] = motor.Transform
end
end
-- Animation:Play()
-- Call this function when the animation is supposed to stop
local function resetMotor6DTransforms()
for _, motor in pairs(Char:GetDescendants()) do
if motor:IsA("Motor6D") and initialMotor6DTransforms[motor.Name] then
motor.Transform = initialMotor6DTransforms[motor.Name]
end
end
end
-- Stop the animation and reset Motor6D transforms
-- This should be called when you want to stop the animation
-- Animation:Stop()
resetMotor6DTransforms()
It’s the other way around, I want them to be established just as the animation stopped, that is, if I use stop() then they are established in that part
You help me or You help me for please
Something like this? Where it captures the Motor6D positions right before the animation stops
local initialMotor6DTransforms = {}
-- Play the animation
-- Animation:Play()
-- Call this function just before stopping the animation
local function captureCurrentTransforms()
for _, motor in pairs(Char:GetDescendants()) do
if motor:IsA("Motor6D") then
initialMotor6DTransforms[motor.Name] = motor.Transform
end
end
end
-- Capture the current transforms before stopping the animation
captureCurrentTransforms()
-- Stop the animation
-- Animation:Stop()
-- Optionally, if you need to reset the Motor6D transforms to the captured state later
local function resetMotor6DTransforms()
for _, motor in pairs(Char:GetDescendants()) do
if motor:IsA("Motor6D") and initialMotor6DTransforms[motor.Name] then
motor.Transform = initialMotor6DTransforms[motor.Name]
end
end
end
It is the same code that I made that does not work, what happens is that it establishes the 6d engines in a strange way and not as indicated by the animation
Help me please, never this forum help me
Malditos ayúdenme por favor please please help me
Help me please help me please for please