Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to script movement for a simple imported character?

I have imported a simple Soldier rig from Blender. The Rig is animated and I need it to move like a normal roblox character would do. I have tried scripting like:

while true do
	Soldier.RootPart.CFrame=Soldier.RootPart.CFrame*CFrame.new(0,0,-0.1)
	wait(0.1)
end

This makes the Character move but it doesn't work when going uphill/downhill. I just need to know how to make the Soldier Character move around like Normal Roblox Characters. Any help is Highly Appreciated. Thanks in Advance.

2 comments

1

you can use humanoid:moveto()

0

Humanoid:Moveto() or Humanoid:Move didn't work at all, because the rig is imported. Its neither R6 or R15. Its a skinned mesh with 64 Bones, including fingers. Please help I'm struggling with this question

1 answer

You can use Humanoid:MoveTo() just as what @JustinWe12 said, but Humanoid:Move() is much preferred if you want a humanoid to walk in a direction.

-- Normal Script inside the Soldier Character
local Solder = script.Parent
local Humanoid = Solider:FindFirstChildOfClass("Humanoid")

for _, limb in ipairs(Soldier:GetDescendants()) do
	if limb:IsA("BasePart") then -- if it's a limb (Part, MeshPart, Union, Accessory, etc.)
		limb:SetNetworkOwner(nil) -- so the solider won't lag
	end
end

Soldier.DescendantAdded:Connect(function(limb) -- if a new limb is added to soldier
	if limb:IsA("BasePart") then -- if it's a limb (Part, MeshPart, Union, Accessory, etc.)
		limb:SetNetworkOwner(nil) -- so the solider won't lag
	end
end)

while true do
	Humanoid:Move(Solider:GetPivot().LookVector) -- makes soldier walk forward
	task.wait()
end

3 comments

0

Unfortunately didn't work, as the Character I have is not in template with roblox's default characters (R6/R15). That may be the reason Humanoid:Move() or Humanoid:Moveto doesn't work. The Character is a skinned mesh with 64 Bones, including a RootPart. I just need it to move around like Humanoid:Move() does. Please.

0

But you said it was 'simple' implying that it's an R6 rig.

0

Can you send me the model? So that I will know what to fix other than Humanoid:Move()

This discussion is preserved as it was. New answers, comments, and votes are closed.