How can I resize a HumanoidRootPart?

I’m currently working on a 3D platformer and I want to include a wall kick script, which detects when the player is touching a certain wall called “JumpWall” and it sets off an event if the player’s HumanoidRootPart is touching it and the player presses Space simultaneously (this runs via two RemoteEvents). However, the HumanoidRootPart never seems to be close enough to the wall to trigger it, so I want to make it non-CanCollide, and bigger. The first one isn’t a problem, but resizing it is, as I have tried resizing the HumanoidRootPart with no succes thus far. Simply typing the following code fails to work (having already set the varible for the HumanoidRootPart):

HumanoidRootPart.Size == Vector3.new(3,2.1,2)

I searched online and found no information or previously asked questions related to my dilemma and thought I might find my answer on here. I would really appreciate some help! Thank you for reading!

1 Like

I might be wrong but the HumanoidRootPart is always collideable if you have a Humanoid in the model.

Anyways instead of onTouch you can always just use ray casting to detect if there’s a part called “JumpWall” in front of the player’s HRP with RunService instead and then fire the event.

3 Likes

I am not sure if this is gonna be any use for you, but inside the player’s humanoid, you can adjust the body’s scaling by changing certain values for example the “BodyDepthScale”. Sorry, if this is not what you are looking for.

2 Likes

If you don’t find a way to do this, I would just suggest welding a part to the HumanoidRootPart that is the size that you would want it to be and then using that for your .Touched event.

You can also use Region3 or Magnitude to determine the distance a player is from an object if that does not work either.

3 Likes

Raycasting sounds very intriguing, I’ll probably look into it and mayble implement in the wallkick function or anythng else. Thanks for the suggestion!

I’ll try this one for starters, seems very straight forward. Thank you!

I like this idea a lot too, I guess I’ll just play around will all the great suggestions you guys came up with and see what works! Whatever happens, now I know 3 possible different solutions. Thank you very much! :smiley: