Making nextbots

soo… my procrastinating self (i cant focus on my projects) decided to randomly make a nextbot.
Now, I saw a little DevForum tutorial on how to do so, however - I also saw you really only need a hitbox. (Also inspired by how evade does it)

Now - how do I make this lil’ guy stand straight and move, and not fall?

image

Is a rig required?

5 Likes

You could make a model, add the Head, Torso, Right Arm, Left Arm, Right Leg and Left Leg but make them small invisible parts, then make the humanoidRootPart the hitbox. Then add a humanoid and use humanoid:MoveTo()

This is what i do when i have to make models that arent rigs a humanoid

1 Like

Fair enough, I guess. Probably how Evade devs do it.

3 Likes

Also make it collidable but make a player collision group i suppose

2 Likes

Oh, and how would I do that? I’ve been hearing about that but I don’t get collision groups - like you toggle some stuff but yeah. Confusing.

2 Likes

I know this is a big hypothetical scenario (and that this isn’t a discussion topic), but what if Velocity would be tweaked instead of using :MoveTo()? I’ve heard that using it is pretty expensive.

2 Likes

image
erm… how do I make this fella not turn his hitbox sideways?

1 Like

Under the model section, click collision groups, then you can create collision groups

For example:

I create a collision group called “Player”. Now i toggle player off on player, meaning parts with the player group wont collide with other parts with the player group. Now i just set all of the parts inside the character to player, and boom! Now players can go through each other!

oh i also forgot, make welds inside the humanoidrootpart and set it to the other parts

Well, a HumanoidRootPart is already enough, there’s no need to add limbs.
image

Really? I thought you needed limbs to make it walk and such

local npc = script.Parent
local hrpOfNPC = npc:WaitForChild("HumanoidRootPart")

local plrsHit = {}
local maxDistance = math.huge

local function applyForce(hrp)
	if not hrp then return end
	if not hrpOfNPC then return end
	local dir = (hrpOfNPC.Position - hrp.Position).Unit
	
	hrpOfNPC.AssemblyLinearVelocity = dir * 16
	task.wait(1)
end


npc.Humanoid.Touched:Connect(function(touch)
	if game.Players:GetPlayerFromCharacter(touch.Parent) and not plrsHit[game.Players:GetPlayerFromCharacter(touch.Parent)] then
		plrsHit[game.Players:GetPlayerFromCharacter(touch.Parent)] = true	
		touch.Parent.Humanoid:TakeDamage(100)		
		wait(1)

		plrsHit[game.Players:GetPlayerFromCharacter(touch.Parent)] = false	
	end
end)

while wait() do	
	local plrs = game.Players:GetPlayers()
	local closestHRP	
	for i, plr in pairs(plrs) do		
		if plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") and plr.Character.Humanoid.Health > 0 then		
			local hrp = plr.Character.HumanoidRootPart			
			local distanceBetween = (hrpOfNPC.Position - hrp.Position).Magnitude						
			if not closestHRP then closestHRP = hrp end		
			if (hrpOfNPC.Position - closestHRP.Position).Magnitude > distanceBetween then				
				closestHRP = hrp				
			end
		end
	end

	if closestHRP and (hrpOfNPC.Position - closestHRP.Position).Magnitude <= maxDistance then applyForce(hrpOfNPC) end
end

( chase script that I saw on the tutorial that I edited)

I edited the script to apply velocity to the hitbox, but for some reason, it instead propels it into the void or whatever, as the moment it loads - its gone

I think there’s a RotationVelocity instance that could fix that I’m not sure if that’s the right one tho

You could try to set the friction to 0 and add align rotation to it. I am pretty sure evade doesn’t use rigs because I’ve seen videos where the nextbot didn’t load properly and there was this red cilinder.

How do I use alignRotation correctly? It’s confusing.

Add an attachment under the part you want the AlignOrientation to work on. After that add the AlignOrientation, set the attachment mode to OneAttachment instead of Two. Set the Attachment0 to the previously added attachment, turn on RigidityEnabled and vióla! It should work now! You can mess with the CFrame>Orientation to control how you wanna rotate it.


this is how it should look like in play mode (mb i forgot to hide the other things)

image
It does seem to work, although he can’t move anymore. I suppose I’m meant to switch to using velocity or whatever?

You mean it can’t move in linear or angular ways?

It can’t move linearly, like, the script uses MoveTo(), and the fella can’t move. Oh, and it’s also stuck to the ground, not sure how to fix that.