How it plays in the editor:
How it plays in-game:
It rotates things but doesn’t move them. Any ideas? I have a feeling something is anchored that shouldn’t be…
How it plays in the editor:
How it plays in-game:
It rotates things but doesn’t move them. Any ideas? I have a feeling something is anchored that shouldn’t be…
To change the position of the character in your animation, you are changing the position of the HumanoidRootPart or the LowerTorso part?
LowerTorso. I tried changing the welds so HumanoidRootPart is welded to LowerTorso from LowerTorso (meaning LowerTorso is anchored and HumanoidRootPart is not) but then it didn’t move OR turn.
Make sure humanoidrootpart of the rig is anchored and unachor everything else, this code should work pretty well for that (you can run it in studio command bar)
local model = -- path to model
for i,v in pairs(model:GetDescendants()) do
if v:IsA("BasePart") and v.Name ~= "HumanoidRootPart" then
v.Anchored = false
end
end
Don’t know how to run multi-line code in the command bar, but also I already checked to make sure all children of the model (except HumanoidRootPart) were unanchored. Still having the problem.
You can just copy and paste the snippet of the code onto the command bar and Studio would run it. The command bar will automatically detect if there are new lines to split up the instructions.
Have you tried setting the animation priority to Action1 or higher? When I was making animations for a custom rig, the animation stood in one spot because I left the animation priority on “Idle”.
I’ll do that, thanks.
Also, the comment was messing it up and it thought that everything past "local model = " was part of the comment
I thought for sure that would fix it, but nothing changed.
That’s strange. If changing the welds and having all but the HumanoidRootPart unanchored did not solve your problem, you can try coding the movement instead. I’ll try to explain it as simple as possible.
First, create a folder in workspace. Call it “MovementParts”. Then create another folder inside MovementParts. Call it “Freddy”. Then, insert two parts into the Freddy folder. Put one at the doorway, and one where you want Freddy to be at the end of the jumpscare. These parts will determine where Freddy will move to. Name those two parts as numbers based on which paths you want Freddy to move to (So the doorway movement part would be named “1” and the jumpscare spot “2”).
Just right after you play Freddy’s jumpscare animation, add the following lines of code, but of course edit the values since I don’t know how your Freddy model is set up:
-- play freddy jumpscare animation here
local FreddyHumanoid = FreddyModel:FindFirstChildOfClass("Humanoid")
if FreddyHumanoid == nil then
warn("Humanoid instance of <" ..FreddyModel.Name.. "> cannot be found, therefore model cannot be moved.")
return
end
for i = 1, #workspace.MovementParts.Freddy:GetChildren() do
local CurrentPart = workspace.MovementParts.Freddy:FindFirstChild(i)
if CurrentPart == nil then
warn("Cannot find MovementPart .. <" ..CurrentPart.Name.. ">, stopping movement.")
break
end
FreddyHumanoid:MoveTo(Vector3.new(CurrentPart.Position.X, FreddyModel.HumanoidRootPart.Position.Y, CurrentPart.Position.Z))
FreddyHumanoid.MoveToFinished:Wait()
end
If Freddy moves too slow or too fast, you can always change Freddy’s WalkSpeed to line it up with the animation. Also, you’ll need to update his jumpscare animation where he doesn’t have to move anymore and he can just stay in one spot.
Tip: You can pause an animation by using
LoadedAnimation:AdjustSpeed(0) -- default value is 1, speed multiplier
I was afraid I would have to code the movement separately. I can probably figure that part out by myself.
I just think that it should be possible to at least change the CFrame position of the parts through the animation.
Also, it’s worth noting that when I unanchored even the HumanoidRootPart, he didn’t move then either, and just fell to the floor while the animation was still playing.
One last option; Would I be able to play the animation normally, like this:
anim:Stop()
anim = ofr.Humanoid.Animator:LoadAnimation(script["dj"])
anim:Play()
Or does an animation that uses movement need different code?
Normally, animations should move even if you animated the movement as you did. So the snippet you provided should work.
May be a shot in the dark but try checking the HipHeight of the humanoid. If it’s too low then it might have an effect on the movement animations.
As a last resort, double-check if the model is properly welded. One small and simple mistake can cause the rig to do whatever it wants to do.
Side note: HumanoidRootPart should always be anchored. The model clipping through the floor is the sole reason why you don’t want it unanchored.
HipHeight might be a problem. It’s set to 0.
WHOA IT MOVES NOW
JUST NOT ANYTHING LIKE I WANT IT TO
I’m just gonna tweak the HipHeight until it works correctly, thanks!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.