Part Is Not Moving Despite Moving the Entire Model

Hello, I am trying to make a map system that involves waypoints that move models derived from server storage to the orientation and position. It has worked mostly fine so far, but there is one glaring problem that not only affects a model or two but other systems I wanted to implement in the future.


(Yes, I know the model is unanchored. But I highly doubt that is part of the problem)

Many of these models have a part on it that interacts with the prompt for an action. However…

This model does not have the part that interacts with the model. In fact, Said part did not move along with the others and instead stayed on the original position.

The strangest thing is that this is the ONLY model in this system that has this direct problem.

NewAppliance:PivotTo(Component.CFrame)

here is the method in which I move the models.

The models have a primary part. Every model, except for the non working one when trying different ideas had no welds. I tried swapping the primary part to the said part. It only dragged said part in instead. I also tried anchoring. (Welding was done with WeldConstraints)

The best thing I can think of is the distance of the original position compared to the requested position. (Which was 50000 studs away since the area is used for testing and I wanted to separate it from the main area). But when trying to move another object closer (Directly done from storage.) the problem still persists.

1 Like

dont think this’ll fix your problem but Model:SetPrimaryPartCFrame() is deprecated and shouldn’t be used. You should replace it with Model:PivotTo()

Also I think you can just do NewAppliance:PivotTo(Component.CFrame) if it’s a part or NewAppliance:PivotTo(Component:GetPivot()) if component is a model

2 Likes

You could loop through each child of the model and move them to the target CFrame.
for example:

for i, part in yourModel:GetChildren() do
v.CFrame = CFrame.new(targetCFrame)

1 Like

If that is the only way I have to get around It I might as well have to use it.

Though I would be on board using this on a slower system, I also have a faster system that has the same problem. I would rather use a more reliable method for that.

1 Like

I tried…

  • CFrame.fromOrientation(
  • CFrame.Angles(

and

NewAppliance:PivotTo(Component.CFrame)
NewAppliance:PivotTo(Component:GetPivot())

They all worked, and the last one can move a model to a part or a model.
Did you make sure and do this part first…

NewAppliance = workspace:WaitForChild("Stove")
Component = workspace:WaitForChild("Component")

This was on me since I forgot to change it but I am using this method now due to a post earlier telling me the old method is deprecated.

NewAppliance:PivotTo(Component.CFrame)

dont think this’ll fix your problem but Model:SetPrimaryPartCFrame() is deprecated and shouldn’t be used. You should replace it with Model:PivotTo()
Also I think you can just do NewAppliance:PivotTo(Component.CFrame) if it’s a part or NewAppliance:PivotTo(Component:GetPivot()) if component is a model

As of the second part,

for i, Component in pairs(ClonedMap.Components:GetChildren()) do
			local NewAppliance = Library.Appliances[Component.Name]:Clone()

Obviously this will not work by itself, but “Component” is a variable from a loop and “NewAppliance” is there from a cloned part.

I would suggest :PivotTo() with either the whole model being anchored, or .CFrame on the primary part of the model, if you weld it and unanchor every part (primary part is the only part allowed to be anchored in this case)
(the later is better for performance, if you move the models often in your game)

This one will move a part or a model to a part or a model.

local NewAppliance = Library.Appliances[Component.Name]:Clone()
--name it, parent it, wait for child (wherever it went), move it.

Ive done that before. It still does not work in terms of moving that one part. Like I said, every other model in this system has worked. Also the model I showed earlier that did have everything intact, were not all anchored or welded at all.

It is moved. Most of the model is.

The one problem is that one of the parts are in the original position instead of the new position despite my efforts on trying to group them together.

Honestly, with now learning that this problem is less of a scripting issue, I might try and ask in a different category, especially since I was confused initially in terms of where to post this.

Could you share the model (as a rbxm or rbxl) because something about that model is probably wrong

BrokenModel.rbxm (41.0 KB)

1 Like

So, the reason your proximity prompt doesn’t work might be because the part in which the proximity prompt is…

… Extremely far away from where the actual model is, about 50k studs

1 Like

(Which was 50000 studs away since the area is used for testing and I wanted to separate it from the main area).

So the problem is based off distance…
I originally wanted this conformed or if there was another way due to the fact I did not want to spend too much effort to relocate again just to find out if this didn’t work. But now that it is a more possible issue, I’ll relocate everything to a much closer part.

Ill look into this and will let you know if this worked.

Ok. Now looking at this, I did not move the part along with entire model when initially trying to relocate that distance away. I don’t know why I didn’t think of this before but thank you for helping.

1 Like

No problem!

There are these little toggles inside of the model tab, in the top ribbon, to show welds and constraints, which is how I was instantly able to see that something was wrong
image