I am trying to create an animal by using a Humanoid in a model. This works for making the model walk around (simply using Humanoid:MoveTo(part.Position)) however it seems I can’t make it jump by setting Humanoid.Jump to true. (is this even how you make players jump?)
How can I make my models “jump” in order to get over obstacles?
Currently I’ve done this which just results with them ascending slowly into space, and I feel this may not be the best way to do it anyways.
-- jumping coroutine.wrap(function() while wait(1) do if script.Parent:WaitForChild("HumanoidRootPart").Velocity.Magnitude < .1 then local vel = Instance.new("BodyThrust") vel.Force = Vector3.new(0,7000,0) vel.Parent = script.Parent.HumanoidRootPart wait(.2) vel:Destroy() end end end)() -- moving around while wait() do repeat block = workspace.blocks:GetChildren()[math.random(1,#workspace.blocks:GetChildren())] until block.Name == "G" script.Parent.Humanoid:MoveTo(block.Position) wait(5) end