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.
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.
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
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.
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)
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.
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.
(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.
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