How do I attach an object to the player character?

Hello,

I’m trying to make a script which will extend the player hitbox by creating a part inside of the player character with a size a bit bigger than the HumanoidRootPart. My script does create the part inside of the player character, but when the players moves, the part won’t go with the player and will stay at it’s spawn place. I’m not that good at scripting, and I didn’t find any solutions or tutorials for that.
How can I make the new part attached to the player HumanoidRootPart?

This is my code:

	local obj = Instance.new('Part', player.Character)
	obj.Size = Vector3.new(2, 2, 2)
	obj.Anchored = true
	obj.CanCollide = false
	obj.Position = character.HumanoidRootPart.Position

This is my first post on Roblox devforum!

1 Like

You can use a Motor6D and attach the hitbox to the player HRP, I mean create a new instance and then set the Part0 to HumanoidRootPart & Part1 to the hitbox. And You don’t need to make it Anchored, otherwise it won’t work

2 Likes