Adonis icon indicating copy to clipboard operation
Adonis copied to clipboard

Change :resize to use Model :ScaleTo() method

Open sakari119 opened this issue 1 year ago • 2 comments

Changes the "resize" command under "Fun" to use the new modern Roblox method Model:ScaleTo to change player size, allowing for animations to be naturally corrected to size.

Video of me testing the method provided https://github.com/user-attachments/assets/64063c26-9729-43a9-b8ed-e8724ea81cab

This is the module script used for the test of functionality for this pull request;

return function (char : Model & {Humanoid : Humanoid}, size : number)
	local num = math.clamp(size,0.01,100)	
	local human = char:FindFirstChild("Humanoid")
	char:ScaleTo(num)
	if not human:GetAttribute("Adonis_OriginalHipHeight") then
		human:SetAttribute("Adonis_OriginalHipHeight", human.HipHeight)
	end
	human.HipHeight = human:GetAttribute("Adonis_OriginalHipHeight") * num 
end

use require(script)(game.Players.<Player>.Character,n) to test this yourself.

sakari119 avatar Oct 19 '24 07:10 sakari119

Does this work with both R6 and R15? Also does this set the humanoid scale values for R15 and if not could it cause some potential issues?

This works for both R6 and R15. The primary method I'm using is player character's model's scale property, not the humanoid instance. This is a property that that makes the model bigger, and from what I have tested, it works as expected. eg: mass is updated accordingly.

Also from further testing I discovered that I do not need to change the hip height.

sakari119 avatar Oct 19 '24 10:10 sakari119

Fixed

sakari119 avatar Oct 19 '24 10:10 sakari119