Custom Character/NPC without Humanoid

  1. What do you want to achieve? Keep it simple and clear!
    A: Do a NPC without use Humanoid.

I’m really frustated at how difficult it is to do this.
(I really searched all about this, everything about this in DevForum)
Humanoidless, luanoid, do NPC with OOP etc…

At moment this is my problem, I did my own R6 Mesh, I rigged all, anchored Torso and Head like a normal NPC.
(How I tried to fix: Body Velocity, Body Position, Body Thurst, Loop with CFrame.)

Custom Humanoid and Large NPC
https://devforum.roblox.com/t/humanoidless-npcs/388157/12

5 Likes

AnimationControllers are another way to have things be animatable without a Humanoid.

Then in the script you call AnimationController instead of Humanoid

local anim = script.Parent.AnimationController:LoadAnimation(script.Parent.AnimationName)

anim:Play()

I’m trying to do the npc don’t fall bro.
(See the video to you see my problem)

That might be an issue because if an NPC has a humanoid you can call the Humanoid Move stuff and that will make the NPC not fall over. I had this issue in the past where my NPC would fall over but when he would move, it stopped it from happening after.

Ohhh this is good, I will try here bro.

I got notified because my thread got linked here.

Hmm how interesting, my first NPCs (where I could have about 1500) those were physics based still, I used humanoids but disabled a lot of states and NPCs that weren’t moving got anchored.

Though, not best method, if you have like 200 of those NPCs walking around at the same time, things like touch events, etc start lagging behind a little and such.

Recently I was going to rewrite NPCs using raycasts instead.

What I basically wanted to do is, 2 raycasts from both shoulders so our custom humanoid doesn’t clip/walk through very thin spaces and 1 raycast downward with of course a check if it’s not too high ground to stand there (we don’t want our humanoid walking up very steep wedges/walls).

Finally to make sure our NPC doesn’t walk into a wall and get stuck/glitch through, if the 2 raycasts from the shoulder hit a wall, always place the humanoid about 2 studs away from the wall by offsetting it.

This is just on the server, also should note that your NPC does not really “move”, it rather teleports over very small distances very quickly (about 4 studs every 0.2 seconds or so, depending on NPC walkspeed).

Now since this is gonna look very choppy, you may want to fully render the NPC on client and do the animations there by checking the X/Z positions and how fast they change/differences between them.
Using TweenService you can tween the client-rendered model to the server position of the NPC, the server version of the NPC will just be an hitbox.

You might want to take ping into mind as well since high ping causes positions to reach the client a little delayed, so if that happens, we slightly slow down the tween so it doesn’t look like as if our NPC stops walking for 1/10 ish second.

This method should work fine, still need to experiment a little myself with how I’m gonna do the raycasts for my custom humanoid but this is how I plan on doing it,
if I got my custom raycast-based humanoid finished I might post like a source code or something so you can see how I have done it.

Hope this helps.

6 Likes

Try anchoring the HumanoidRootPart of the NPC. It won’t fall over that way. If you want the NPC to move, you could try using TweenService and sync up the Walk animation with it through trial and error.