Make a Noclip for a humanoid

hello, I created this post after another post but both are not affiliated, I put the link anyway Allowing a humanoid to cross walls - #13 by sheppard929

In short, I wanted to make an NPC that has no collision (except with the player), and that literally “flies”
I tried a few things without success, I can’t completely “Remove” the gravity of the NPC so that it goes up and down, in short where there is a player

the question is: “How can I remove the total gravity of a Humanoid/Part”? so that if it can move in the desired direction

1 Like

Tried using a BodyPosition?

It should be convenient to use this in your case, as you can move your npc “in the desired direction” by setting the Position of the BodyPosition.

1 Like

I used a BodyForce, not a BodyPosition, it’s to try but I’ll do it later because I have something to do before that

A BodyForce equivalent to the workspace’s gravity would definitely fix the problem. Gravity is an acceleration down and you need a BodyForce to cancel out the acceleration. Apply the gravity force in the Y-axis(that’s what up and down is)

To find gravity, it’s in workspace.Gravity.

…oh, and in case you fly up in space. You could change the velocity of the character directly without any change over time.

1 Like

Remember to respect the part’s mass. You’d probably be best off creating a BodyForce in the root part of the constellation and setting BasePart.Massless to true for all other parts within the constellation.

rootPart.BodyForce.Force = Vector3.new(0, rootPart:GetMass() * workspace.Gravity, 0)
3 Likes

hello again

before discussing the main problem, I noticed that it was impossible to remove the collisions from the NPC

so I tried it with the BodyForce and here’s what I did

I put a BodyForce in HumanoidRootPart, all other NPC parts are Massless (except HumanoidRootPart)

I used the @Flubberlutsch code

Result = It doesn’t take off from the ground when I’m higher than him
and there’s something very funny going on that I noticed
here is a screenshot

The result is supposed to be
The humanoid moves towards the hunted player (the nearest player) by crossing the material regardless of his position and killing him

I just thought about it but what I want to do is a kind of Noclip if we can summarize it easily, it already makes my idea clearer

Using Collission Groups would be much easier, because it’d surely not collide with any walls if they are in that specific group.

There won’t be any errors if ya use any body movers tho.

2 Likes

Great idea for collisions,
For gravity, knowing that it has 192.2
to counter the force of gravity, in Y I have to put 192.2 or -192.2?

Which body mover is it?

If it’s Velocity then the Y should be positive if you want it to counter gravity.

1 Like

Be sure to read @Flubberlutsch post up above. You have to account for the parts’ masses & he directly references workspace.Gravity so that it will work on any map no matter what gravity is set to.

1 Like

I’m going to test this later. I’m going to have something unexpected.
I’ll see you later.

Parts have a boolean massless value. idk if it’ll work but you could try setting massless to True?

1 Like

I tried to turn on Massless for each part of the model but he is still (but less) attracted to the ground.

It’s okay, he no longer has a collision and is no longer subjected to gravity.
however, when he follows me, he stays at the same height
how I could make it change height (ordinate) when it follows me

Changing sizes of R15?

I think there’s values that lets you changed them, it’s what weight lifting simulator used to resized their body, just check the humanoid and check if there’s a value and try changing them, you’ll see that they’ll change size.

1 Like

Oh, excuse me, I may have misspoke.
I wanted the height in relation to the Y axis
when I’m under the NPC, it doesn’t go down, it stays at its height (Y axis)
and it’s the same when I’m above him, he’s heading below me but doesn’t change altitude

There are a whole load of open source modules which can do this, one of the more famous of which is HD Admin.

Take a look at the source, in particular the noclip command.

1 Like