Multiplying Positions, I kinda need help

I am relatively new to scripting, currently I have been working on modifying an R6 resize script (I only use R6 for my morphs and things like that, even tho R15 is better for resizing, i’d rather not use it). Everything was working fine, until I got to resizing the 3D(Parts, Meshparts,etc) Inside the script. I got this line of code

image

for context, the percent variable is equal “2”.

rather than morphing into this
image

I morphed into this
image

how exactly would I fix this?

from what appears to me, the positions stayed the same, thats why I tried the line of code above, it didnt work tho

Could you show us the child hierarchy of the model? The parts names might not be “Hulkbuster(Model87)” that aren’t being moved correctly.

They are, I checked for that, either way here lemme take a screenshot
image
Its all named that so all of em would resize

Im using GetDescendants, so I wont have to name them 1 by 1

And you’ve confirmed that every single part is being resized, correct? It’s only the positioning that is off?

correct, otherwise they would be inside the player once he’s resized

Maybe try getting the vector position relative to the HumanoidRootPart, and then multiply that by 2, and use the HumanoidRootPart to offset its position for the new position of the parts. This would make sure certain parts aren’t shifted relative to the origin, but rather in relation to the root.

Oh that seems like a good idea, thank you…i’ll try it and get back to this topic

1 Like

Would it look something like this?
image

if so, it didnt really work…Sorry if I sound kinda dumb, im new to this part of scripting

Update, i’ve been trying it with CFrames and Vector, still doesnt appear to be working, current code

image

for _, Part in pairs(player.Character:GetDescendants()) do
	if Part.Name == "Hulkbuster(Model87)" then
		local Offset = Part.Position - player.Character.HumanoidRootPart.Position
		
		Part.Position = player.Character.HumanoidRootPart.Position + Offset * Percent
	end
end

Also CFrame.Vector3 isn’t even a thing

It still didnt work, parts are still inside the player

Oh…Okay that makes sense, but it wasnt really helpful

I mean, it was, but it really doesnt fix my issue…Sorry if I made it seem a bit mean or out of maners, I spent yesterday night and morning today attempting on fixing it

What I sent should have fixed it, although I would have used CFrame if I coded it on my own. If I had to take a guess, you built it improperly or there are other things in the script messing things up.

But good luck with your problem! Sorry it wouldn’t be fixed.

You know, with the addition of attributes, you could easily go in and add a Vector3 value that hold the object’s relative position to the center of the parent object, and then in a script, run through and set those values once at the beginning of the game, and then call them later when you need to scale.

Edit: You could’ve done this with Vector3Values too, but it’s not as organized in my opinion.

I dont think the problem is the specific center point for scaling youre choosing
Does your object contain any accessories?
It seems like its working for some parts but not for others

No, it contains 3D Parts, Im inserting it on a morph