How to make an unanchored model still be able to move but not fall over?

Hi! So I have a dog that will attack something from a specific place. But the problem is that the dog keeps falling over. Is there anyway to avoid this?

DogAnim in Animation Editor:
robloxapp-20210314-1834491.wmv (114.7 KB)

DogAnim in game:
robloxapp-20210314-1909270.wmv (1.9 MB)

Dog Script:

local mob = script.Parent
local replicatedStorage = game:GetService("ReplicatedStorage")
local chickens = replicatedStorage:WaitForChild("Chickens")
local coolDown = 5
local attackAnim = mob:WaitForChild("AnimationController"):WaitForChild("Animator"):LoadAnimation(mob:WaitForChild("AttackAnim"))


if mob.Parent:IsA("Folder") then
	while wait(coolDown) do
		for i,v in pairs(mob.Parent:GetChildren()) do
			if chickens:FindFirstChild(v.Name) then
				if v:FindFirstChild("Humanoid") then
					local cframe = CFrame.new(mob.Parent.FarmerPlacements[mob.Name].Position, v.PrimaryPart.Position)
					mob:SetPrimaryPartCFrame(cframe)
					v:FindFirstChild("Humanoid"):TakeDamage(5)
					attackAnim:Play()
                                        wait(attackAnim.Length)
					mob:SetPrimaryPartCFrame(cframe)
					
				end
			end
		end
	end
1 Like

Try making all its parts have the custom physical properties of 100 density, 0 elasticity, and 100 ElasticityWeight. If you want to put it in a script/the command bar, do this:

local des = MODEL:GetDescendants()
for i=1,#des do
   if des[i]:IsA("BasePart")then
      des[i].CustomPhysicalProperties = PhysicalProperties.new(100,0.3,0,1,100)
   end
end

Sorry, it still falls down the same way as before. I have checked the Custom Physic Properties and it is exactly how you described

Did you try to give it a BodyVelocity? It could probably be useful

Why would I need a body velocity? And if I do how would I use it on a mob? I want something that can make it stay in place but still be able to move and cancollide is off

try replacing animation controller with humanoid, Iā€™m pretty sure it needs a humanoid to stay balanced, I could be wrong.

1 Like

If you set its velocity to (0, 0, 0), it can emulate the Anchored property without anchoring it. It will still be able to move and stay in place (I think?)

5 Likes

Thanks a lot! I added a Body Velocity to the primary part with Velocity to (0,0,0). Worked like a charm!

bodyvelocity set to Vector3.new(0,0,0) will make the part not get affected by physics, BUT can still be freely moved around, if you dont want that to happen, i would reccomend a BodyPosition