:ScaleTo() Changing WalkSpeed and JumpHeight

Hello, developers.

So, I’m making a game, that changing scale of the character.
The problem is when I scale my character, it makes WalkSpeed and JumpHeight grow.

I don’t know how to solve this problem, I hope I will find answer here. Thanks

You can just manually set the walkspeed and jumpspeed to what you want from the Humanoid

I tried to did that, I did Character.Humanoid.WalkSpeed =Character.Humanoid.WalkSpeed - 0.01, but it still grow it speed with jumpheight.

.01 of walkspeed is basically nothing, try doing Character.Humanoid.WalkSpeed = 16 (or whatever the default is)

That is not exactly what I want.

Like, when the player grows, he’s becaming slower and slower.

So is :ScaleTo() in a loop? Could you send the script so I understand better

Thats because the walkspeed of a Humanoid defines how fast it walks in studs, it does not have any increment with the characters size, you would need to do the math yourself:
DefaultWalkspeed*NewSize

local UIS = game:GetService(“UserInputService”)
local Character = game.Players.LocalPlayer.Character
UIS.InputBegan:Connect(function(Input)
local mouse = UIS:GetMouseButtonsPressed()

for _, button in pairs(mouse) do

  if button.UserInputType.Name == "MouseButton1" then
  	
  	print("MOUSE!")
  	Character:ScaleTo(Character:GetScale() + 0.001)
  	Character.Humanoid.WalkSpeed =Character.Humanoid.WalkSpeed - 0.01
  	
  end

end

end)

you can just use the Input parameter to know if MouseButton1 was pressed

also next time try using the </> button when pasting a script

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

local Player = Players.LocalPlayer
local Character = Player.Character or Players.LocalPlayer.CharacterAdded:Wait()

Player.CharacterAdded:Connect(function(newCharacter)
	Character = newCharacter
end)

UIS.InputBegan:Connect(function(input, gameProcessedEvent)
	if gameProcessedEvent == false then
		if input.UserInputType == Enum.UserInputType.MouseButton1 then
			print("MOUSE!")
			Character:ScaleTo(Character:GetScale() + 0.001)
			Character.Humanoid.WalkSpeed -= 0.01
		end
	end
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.