How do I resize the HumanoidRootPart? [Solved]
I have created a crawl script to make the character crawl through an opening.
I created this localscript parented to StarterCharacterScripts.
01 | local UserInputService = game:GetService( "UserInputService" ) |
02 | local Character = script.Parent |
03 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
04 | local Anim = Humanoid:LoadAnimation(script:WaitForChild( "CrawlAnim" )) |
05 | local AlreadyPlaying = false |
06 | Humanoid.Running:Connect( function (Speed) |
17 | UserInputService.InputBegan:Connect( function (Input) |
18 | if Input.KeyCode = = Enum.KeyCode.C then |
19 | if not AlreadyPlaying then |
23 | Humanoid.WalkSpeed = 8 |
24 | Humanoid.JumpPower = 0 |
27 | Humanoid.WalkSpeed = 16 |
28 | Humanoid.JumpPower = 50 |
29 | AlreadyPlaying = false |
The problem is that the HumanoidRootPart is blocking the way. Like this.
I tried Adding this code to line 5:
1 | coroutine.resume(coroutine.create( function () |
3 | local HumanoidRootPart = Character:WaitForChild( "HumanoidRootPart" ) |
4 | local UpperTorso = Character:WaitForChild( "UpperTorso" ) |
5 | HumanoidRootPart.Position = UpperTorso.Position |
6 | HumanoidRootPart.Orientation = UpperTorso.Orientation |
7 | HumanoidRootPart.Size = UpperTorso.Size |
Then the character starts going like crazy. How do I fix this?