Weird bug when changing a part's shape and its size at the same time

Basically I have a script that takes a part and allows me to make whatever changes I want to it. Everything else works fine, but trying to change the shape and size at the same time doesn’t seem to work

In my script, the default size is 7,7,7, and the shape is the PartType “Ball”.

I have a function that changes this part to PartType “Block” and changes its size to 6,6,20. This doesn’t want to work, and instead changes its size to 6,6,6. It also does the same thing when I do 10,10,20 as well.

Super confused on this, and any help would be appreciated

Example:

--Template
local CurrentHitboxParams = HitboxModule.NewBehavior()
CurrentHitboxParams.Provider = Provider
CurrentHitboxParams.Template = nil
CurrentHitboxParams.Shape = Enum.PartType.Block
CurrentHitboxParams.Size = Vector3.new(6,6,20)
CurrentHitboxParams.Damage = 10
CurrentHitboxParams.ExistTime = 10
CurrentHitboxParams.Name = "Hitbox"
CurrentHitboxParams.Ignore = "Ally"
----------------------------------------------
NewHitbox = SentHitboxParams.Provider:GetPart()
--Set its properties
--Constants
NewHitbox.Material = Enum.Material.ForceField
NewHitbox.Color = Color3.fromRGB(255,0,0)
NewHitbox.Massless = true
NewHitbox.Anchored = true
NewHitbox.Transparency = 0
--Alterable
NewHitbox.Shape = SentHitboxParams.Shape
NewHitbox.Size = SentHitboxParams.Size
NewHitbox.CFrame = CFrame
NewHitbox.Name = SentHitboxParams.Name

Sorry if this is a little hard to understand, was sort of in a rush

I’d recommend checking what the SentHitboxParams.Shape value is before changing the size. For example, check it’s an Enum.PartType.Block when you change its size.

erm, when i print out its size and shape after applying it, it says the correct size and shape, but visually its different
It uses a part cache script that i took from another script, but i only use it for returning and using parts

defaulting the part shape to “Block” makes it work, but as soon as i do another move it screws it up
so basically, if the part type is “Ball”, then the size messes up and basically makes it what the sphere’s size would’ve been.

ok so i made it when that it returns a part, it resets its shape to “Block”, and that seems to be a temporary fix for now

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