My goal is to make sure every player in my game has the same character hitbox for a more fair gameplay scenario. My game is loosely based around (in the simplest way possible) pushing a boulder up a hill. That being said, with how the physics engine in Roblox works, if your character’s hitbox is taller then it is much easier to push a sphere up an incline.
With the new roblox update allowing custom character bundles, I have realized that certain bundles allow some players to be able to push the rock much easier than other players, specifically short bundles vs tall bundles. So the only two options I can think of are either limiting each player to the default Roblox bundle (which I really do not want to do) or somehow managing their hitbox to make them all the same without changing their player model. That being said if there is another way I can code the pushing of the rock or if I’m missing something I’m open to new suggestions.
I know that I am able to force a bundle on every player that joins but I don’t want to limit the player’s freedom of character choice if I don’t have to.
Let me know if you have any more questions about the game, thank you!
So the idea of a hitbox is pretty simple. Just have a box (part) with the dimensions you want, and then attach it (using WeldCosntraint) to a player. Whenever someone makes contact with that part(hitbox), threat that like a attack and deal the necessary damage.
I don’t understand, do you mean I can choose the hitbox through code? if so how would I do it… because obviously, the player has a default hitbox from the start…
You would script a .Touched event for the parts that you created for your custom hitbox. In Studio you can turn off CanCollide for the characters so that the only Hitbox would be the one that you added.
After looping through the player’s character on the player-added event, and setting every BasePart to canCollide false, the player is still colliding with everything, although it sometimes manages to phase through parts. I even tried running this in a while loop to constantly set their parts to not collide. Can you give me more information on setting the character to not collide?
My attempted code:
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
for _, part in character:GetChildren() do
if part:IsA("BasePart") then
part.CanCollide = false
end
end
end)
end)