Making a HumanoidRootPart not standup straight


#1

I have a vehicle-based NPC in my game that uses a humanoid, which it contains the basic parts: HumanoidRootPart, Torso, Head. I’m trying to make it where it runs up ramps correctly. For example:

What I’m trying to accomplish is this:

But instead, it does this:

I’ve looked through the properties of the humanoids in the wiki to see if there’s a property I can trigger to prevent the HumanoidRootPart from just standing up straight, but I don’t see any so. I’m thinking about just adding real invisible wheels to it (because the wheels in the NPC are fake, not collidable, and animation based), but I’m not sure if it would work. What should I do?


#2

@EgoMoose created a custom character controller that allows walking on ramps, walls, etc.


#3

That’s a good and very unique article, but I don’t think it’ll help in my case.


#4

Raycast downwards and adjust rotation based on surface normal.


#5

Doing that does work, but the problem is that I have to leave PlatformStand on true.

I can’t leave it on true because the humanoid has to use MoveTo, and setting it on false makes it goes into shiver mode.

So, :man_shrugging:


#6

Humanoids are pretty wack. I’m not sure if a humanoid would be your best bet for what you’re trying to accomplish, unless there’s an easy workaround somewhere. Seriously wish they’d give us more control over them…


#7

Rotate the model separately based on the angle of elevation. This would imply that the head, torso, rootpart will be invisible and the model will be relative to the rootpart position.

Probably makes no sense, it’s fairly hard for me to explain things that only make sense to me.


#8

Not sure if a npc can use a vehicleseat when using moveto on their humanoid, you should experiment with that. ;p


#9

I have a placefile on my computer that adjusts the root motor6d to have a humanoid tilt to what they are standing on. It does not allow you to walk up walls etc. Its just visual which is i believe what you want?

I am on my phone though, so if i dont post it at some point tonight plz DM bc i prob forgot.


#10

Is this going to be a strategy game?


#11

Why use a Humanoid for this NPC?


#12

As promised here’s the placefile.

CharacterTilt.rbxl (14.6 KB)


#13

Like EgoMoose posted, I would recommend that you shoot a ray downwards to get the rotation of the part that is under the ballista, and change the HumanoidRootPart’s RootJoint cframe to match the CFrame of the part below it.


#14

Besides this post, though this is very usefull for a project of mine, thank you!


#15

Question, how should i go around getting the rotation to replicate to the server? Wouldnt using a remoteevent every 1 second cause it to look off?


#16

Prob best to use a body move of some kind to replicate the CFrame. There’s quite a few ways to go about it, but you have to get creative.


#17

You could probably update each players root joint CFrame on the client every second. You don’t need the server to do all the work, however. Unless you need it to update for positions or something, I would recommend doing it client side, since it puts less stress on the server.


#18

Ahh thank you. Will try doing this.


#19

Mostly because the MoveTo function in the humanoids are primarily favorable for me to use on NPCs (and also it helps with easier detection configuration for items in the game). It is possible to remove it and then use a body mover or just do some CFraming method if necessary, but since the game is planned to be flooded with NPCs that do complicated tasks, i think it’s more reliable to use in my opinion. Eh?


#20

This is exactly what I was looking for, thanks!