I need help resizing a welded part in only 1 direction

Hello,
I want to resize Part A in one direction only, this part is welded to part B, so if u rotate that Part B, it will rotate Part A. I’m using a DragDetector that only rotates in 2 axis. And what I mean with resizing in only 1 direction, I mean like how the resize tool in studio works.

I’ve tried everything ive searched, like :Resize(), Resizing + changing CFrame but I still can’t find a solution. If I use :Resize(), strangley enough it resizes Part A in both directions, which i know it isnt suppose to happen, so its fustrating; If i use the CFrame method, it still resizes on both directions and messes with Part B’s CFrame

Edit: I do wanna mention that i do have these in a while loop that repeats very fast and that could be an issue since im testing this on a different place

Example of what happens when I use :Resize():

Example of what happens when I use the CFrame method:

I am using a Weld instead of a WeldConstraint because i wanted to use :Resize() but it doesnt work as i want it to.

Here’s the code of what i did for both

-- :Resize()
arrow:Resize(Enum.NormalId.Top, 0.75)

-- Resize + CFrame
local tween = TweenService:Create(arrow, TweenInfo.new(0.0075), {
					Size = arrow.Size + Vector3.new(0, 0.75, 0)	
				})
tween:Play()
arrow.CFrame = arrow.CFrame * CFrame.new(0, 0.375, 0)

I also tried to tween the CFrame but nothing would happen so i put it outside the tween, and im resizing and/or moving on the Y axis cause of how Part A is rotated.
I really would appreciate it if someone could help me with this because ive been stuck on this for few hours while sick lol

Whenever you change the size you need to also change the position by 1/2 the size change

2 Likes

I already did that, 0.375 is half of 0.75

so that big size change is just 0.75 studs?

its a loop that repeats a lot of times, thats why its that small

So i ended up figuring it out how to fix it, so if anyone has a similar case, here’s a little guide with some information you might find useful in the future:

You cannot change the CFrame of a part that is connected to another part with either a Weld or a WeldConstraint with a tween, if you do it outside the tween, it will move the whole welded object togheter, which in my case i dont want it to.
With this in mind i figured out (i shouldve figured this out sooner) that you had to change the C0 or C1 of the Weld, so in my case its C1 because Part A is C1 of my weld. Unfortnunately I’m not sure how you can do this without needing 2 tweens if you want the whole thing to look smooth, but anyways here’s the code:

local tweenSize = TweenService:Create(part, TweenInfo.new(0.0075), {
		Size = part.Size + Vector3.new(0, 0.75, 0),
	})
local tweenCFrame = TweenService:Create(part.Weld, TweenInfo.new(0.0075), {
		C1 = part.Weld.C1 * CFrame.new(0, -0.375, 0) 
		-- You can try either positive or negative, i tried positive but didnt work how i wanted to so i decided to make it negative and it worked
	})
	tweenSize:Play()
	tweenCFrame:Play()

If you’re also doing this in a loop, you have to make the tweens in the loop because else it uses the original size and cframe so it only changes once.

Edit: also because the tween last’s that short, its kinda pointless doing it in a tween, so thats a fault on my part.

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