How can i set the hipheight... of a rapidly growing ball

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    a simple eat other players game for no reason
  2. What is the issue? Include screenshots / videos if possible!
    i cannot calculate the size.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    tried searching, that failed…
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
script.Parent:FindFirstChildOfClass("Humanoid").Touched:Connect(function(TP, HP)
	if TP.Parent:FindFirstChildOfClass("Humanoid") and TP.Parent.HumanoidRootPart.Size.Magnitude <= script.Parent.HumanoidRootPart.Size.Magnitude then
		script.Parent.HumanoidRootPart.Size += TP.Parent.HumanoidRootPart.Size
		TP.Parent:Destroy()
	end
end)

game["Run Service"].Heartbeat:Connect(function()
	script.Parent:FindFirstChildOfClass('Humanoid').HipHeight = script.Parent:FindFirstChildOfClass("Humanoid").RootPart.Size.Y / 2
	script.Parent.HumanoidRootPart.SelectionSphere.SurfaceColor3 = Color3.fromHSV(script.Parent.HumanoidRootPart.Size.Magnitude / 10, 1, 1)
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

Could you provide more info? Screenshots would be helpful.

1 Like

Screenshot 2024-11-09 232607


Screenshot 2024-11-09 232556
Screenshot 2024-11-09 232550
Screenshot 2024-11-09 232548

Can you send screenshots of explorer, where the balls and scripts are located, and full script

1 Like

thats literally the full script. in startercharacterscripts.

Sorry I have too little info to go on here. What solutions have you tried? Are there any errors?

Can you please be as specific as possible so that I may help you?

Basically, i need to calculate how far the ground should be from the ball itself.
Dividing it’s size by 2 will not work as I already tried that. It should not float off of the ground, and the ball is the player. No errors, and I cannot find anything to help me.

You might be able to accomplish this with raycasting, can you try the code below? I am not 100% sure it will work as I don’t have all the necessary components to experiment myself, but do let me know if it doesn’t solve your problem

local humanoid = script.Parent:FindFirstChildOfClass("Humanoid") :: Humanoid
local root = humanoid.RootPart

local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.IgnoreWater

humanoid.Touched:Connect(function(TP, HP)
	if TP.Parent:FindFirstChildOfClass("Humanoid") and TP.Parent.HumanoidRootPart.Size.Magnitude <= root.Size.Magnitude then
		root.Size += TP.Parent.HumanoidRootPart.Size
		TP.Parent:Destroy()
	end
end)

game:GetService("RunService").Heartbeat:Connect(function()
	raycastParams.FilterDescendantsInstances = {humanoid.Parent}

	local result = workspace:Raycast(root.Position, Vector3.new(0, -100, 0), raycastParams)

	if result then humanoid.HipHeight = root.Size.Y / 2 - result.Distance end

	root.SelectionSphere.SurfaceColor3 = Color3.fromHSV(root.Size.Magnitude / 10, 1, 1)
end)

Screenshot 2024-11-09 235403

Change this line
if result then humanoid.HipHeight = root.Size.Y / 2 - result.Distance end
To this:
if result then humanoid.HipHeight = root.Size.Y - result.Distance end

Again it’s really hard to help you when I don’t have all the necessary info so please be patient with me

1 Like

jumping in a nutshell:
Screenshot 2024-11-09 235809
becomes cat bobbing meme
the character is literally just a normal ball, i don’t know why you are complaining.
sc.rbxm (11.1 KB)

if u wanna just change the hip height then insert a humanoid into starterplayer and change its hipheight ( this is definitely not what u wanted )

I cannot. I need it to change whilst growing rapidly, or shrinking rapidly.
Also i figured it out, Here’s the code!

script.Parent.HumanoidRootPart.SelectionSphere.SurfaceColor3 = Color3.fromHSV(math.random(1, 100) / 100, math.random(1, 100) / 100, 1)
script.Parent:FindFirstChildOfClass("Humanoid").Touched:Connect(function(TP, HP)
	if TP.Parent:FindFirstChildOfClass("Humanoid") and TP.Parent.HumanoidRootPart.Size.Magnitude <= script.Parent.HumanoidRootPart.Size.Magnitude then
		script.Parent.HumanoidRootPart.Size += TP.Parent.HumanoidRootPart.Size
		script.Parent.HumanoidRootPart.Position += Vector3.new(0, TP.Parent.HumanoidRootPart.Size.Y, 0)
		script.Parent:FindFirstChildOfClass("Humanoid").WalkSpeed += TP.Parent.HumanoidRootPart.Size.Y
		TP.Parent:FindFirstChildOfClass("Humanoid").Health = 0
		script.Parent.HumanoidRootPart.SelectionSphere.SurfaceColor3 = Color3.fromHSV(math.random(1, 100) / 100, math.random(1, 100) / 100, 1)
	end
end)

game["Run Service"].Heartbeat:Connect(function()
	--local Result = workspace:Raycast(script.Parent:FindFirstChildOfClass("Humanoid").RootPart.Position, Vector3.new(0, -100, 0))
		-- script.Parent:FindFirstChildOfClass("Humanoid").RootPart.Size.Y 
		--script.Parent:FindFirstChildOfClass("Humanoid").HipHeight = -2
end)