As you can see in the video, it “moves” the Dummy back into the original place upon the animation stopping. I don’t want that. The movement when the animation starts can be fixed by putting 0 as the first parameter when calling anim:Play(), but nothing seems to fix the movement when the animation ends. How do I fix this? Basically instead of “tweeting” it, I just want the dummy to move back in place as like a teleportation.
No transparency changes, please. If you watched the video, you’d see that the character “tweens” the position when the animation plays or stops. I want to remove that.
@Wertyhappy27 and @DrDarkBlock, there is no actual tweening for the character. What you see in tge command bar is just me loading and playing an animation on the dummy. It consists of moving the dummy to another position and rotating he arm (just an example animation). What I don’t want is to see the animation blending with the default position (meaning that you see the dummy “tweening” to the animation’s position), instead to teleport it there. I am not looking for PivotTo or stuff like that, just to stop the animation from “dragging” the dummy. If you still don’t understand, I can provide a place file with the dummy and animation, so that you can maybe understand better. Further explanation, if you may, is that when you load the animation inside the animation editor, the rig “teleports” to the animation position. When you load and play it using scripts, the dummy very rapidly moves to the animation position (can be fixed using the 0 parameter in Play()) but when the animation stops, it moves a but slower to the original position. Does this make sense?
im not talking about a tweenservice tween, when making an animation there is a tween between each keyframe, inside of the animation editor, change the easing style to constant, rather than linear. right click the keyframe on the animation track, itll be in the widget that shows.
just an idea have you tried clicking the 3 dots and chainging the priority
movement action1 action2 action3 core
try setting it to actionn 4 or 3
not sure if its gonna work you gotta show us the animation tab
The animation is really simple, it just changes the position of the Torso to a different one and rotates the arm (so that you can see it’s playing). As far as I’m aware changing the priority does not interfere with the issue.
very very very sorry for the late reply, I was very busy throughout this time, now I just got some time working on the code, here is proof that the code I provde you works:
Without the anti tweening system:
With the anti tweening system (still the same animation):
Sourcecode and explanation:
local Animation : Animation = script:WaitForChild("Animation")
local Animator : Animator = script.Parent:WaitForChild("Humanoid"):FindFirstChildWhichIsA("Animator")
local AntiTweenTime : number = 0.01
local RunService = game:GetService("RunService")
local function AdvancedWait(Time) if not Time then Time = 0 end
local t = os.clock
local target_t = t()+Time
repeat RunService.Heartbeat:Wait() until t()>=target_t
end
local LoadedAnimation = Animator:LoadAnimation(Animation)
repeat AdvancedWait() until LoadedAnimation.Length>0
-- Plays the animation
LoadedAnimation:Play(0)
-- Waits almost exactly until animation should be done
AdvancedWait(LoadedAnimation.Length-AntiTweenTime)
-- Stops the animation manually to prevent tweening
LoadedAnimation:Stop(0)
Explination:
What I did is, I made a system which manually stops the animation 0.1ms before the tweening will trigger it, so it wont interfere with the animation and its keyframes.
For most accuracy I also made a better waiting system which is based on the os.clock api, os.clock() returns a number, which is the cpu time on roblox/roblox studio.
I hope I could help you with your issue, if so then you can mark this reply as “The Solution”.
local animation = script:WaitForChild("ID")
local humanoid = script.Parent:WaitForChild('Humanoid')
local animator = Instance.new('Animator')
animator.Parent = humanoid
local loadAnim = animator:LoadAnimation(animation)
while wait(2) do
loadAnim:Play()
end