Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to move a Part that is welded to a anchored part?

Asked by 1 year ago
Edited 1 year ago

I am trying to move a part by using cframe but when it is welded to a anchored part I just cannot move it.

And I need to have it welded to an anchored part because it is a building game.

Say for example I have a turret how would I move it.

I have already tried unwelding and rewelding which works fine but.

I want to know if there are any way I can move it without doing that or if there are other solutions instead of welds

The current behavior is that when I try moving a part that is welded to a anchored part

It just dosen't move.

I have a non anchored part welded to a anchored part which is the baseplate

Any Suggestions would be useful.

Here is a example of what i want to do


Part.CFrame = Part.CFrame * CFrame.Angles(0,math.rad(90),0)

There are no errors into this code but because of the anchor and the weld

it does not move AT ALL!

1 answer

Log in to vote
0
Answered by 1 year ago

My personal recommendation would be putting the whole thing into a model and making use of :SetPrimaryPartCFrame(). It's much simpler. Also, make sure you're using WeldConstraints and not Welds.

0
First of all :SetPrimaryPartCFrame() is deprecated and should be replaced with :PivotTo() which I did use I also used weld constraints and the problem still occurs what I am looking for is another solution to Welds or Weld Constraints Overseer_Prince 188 — 1y
0
I don't see where your issue is arising from then. When moving a part using its CFrame or Position, whether it's anchored or not doesn't matter. And since you're using CFrame, the part and all connected parts through welds should move just fine. So, there's likely a mistake somewhere in your code that isn't specifically tied to the movement itself. It would help if we could see your code though. XxTrueDemonxX 362 — 1y
0
OK let me explain what I think is going on because I don't think you understand. Overseer_Prince 188 — 1y
0
I am trying to move a non anchored part's CFrame which is welded to an anchored part. When it is welded to a anchored part it just won't move because it is anchored. I know this because when I unanchored the part it moved the two parts which is even worse since it tilted the entire baseplate Overseer_Prince 188 — 1y
View all comments (15 more)
0
If your model is flexible for editing then the easiest solution would be likely to unanchor the whole thing, slap an invisible "base" part down, then proceed to weld all the parts exactly to that base since, with the welds, they won't fall apart even though they're not anchored in place. XxTrueDemonxX 362 — 1y
0
Imagine this: A Player builds a turret onto a baseplate which "NEEDS" to be anchored. I've also tried your suggestion which was to "slap an invisible base part down, then proceed to weld all the parts exactly to that base" which I found out that if the "invisible part" is welded to anything anchored or any part is welded to anything anchored even if not directly it will still show the same behavi Overseer_Prince 188 — 1y
0
No, my issue is seeing where your problem actually is. I've just recreated a similar scenario in a blank world. A black base brick that is anchored and a blue "float" brick that isn't anchored. Every 1 second I have it go up one stud. So again, not seeing what your actual issue is with not being able to modify it when I'm able to modify things just fine in a similar scenario. XxTrueDemonxX 362 — 1y
0
You are using weld constraints for this? Overseer_Prince 188 — 1y
0
I just tried what you tested. It's moving the entire baseplate up with it. Overseer_Prince 188 — 1y
0
Yes. Just one weld constraint between the two. I can even replace the base brick in weld constraint with any other brick in my game as well and they will all start floating up with the float brick just like the base brick does. XxTrueDemonxX 362 — 1y
0
Yes. With weld constraints if the part being moved is anchored then only it will move but if it's not anchored, it'll take everything connected to it, with it XxTrueDemonxX 362 — 1y
0
That's the problem I am facing I can't figure out a way to get a Non Anchored Part to move without taking everything welded with it. Overseer_Prince 188 — 1y
0
So, for example, I put a second weld constraint in that binds the base brick to the baseplate itself and left the original constraint connecting the base brick and the float brick, and the float brick ONLY takes up the base brick it's directly attached to, not the baseplate itself even though it's indirectly attached through the base brick XxTrueDemonxX 362 — 1y
0
If you're wanting this object to move independently of the "turret" why is it welded to it in the first place? XxTrueDemonxX 362 — 1y
0
Its welded because players build a base and every single thing that they build is built or welded to a baseplate because the blocks build on each other and the parent hierarchy will always lead to a baseplate Overseer_Prince 188 — 1y
0
I was wondering if there was any other constraint that can let me move the turret indepenedantly Overseer_Prince 188 — 1y
0
Not too familiar with the other constraints unfortunately. Never needed them. Why is the turret itself unachored though? Is there a specific reason? If you use an invisible anchored base block with all parts of the turret welded to that, then when you move the base block it'll move all unachored parts attached to it. If the baseplate is moving with it, then your baseplate isn't anchored. XxTrueDemonxX 362 — 1y
0
Its cause the blocks can be destroyed and when destroyed they will fall and physics will take over which is why it needs to be unanchored unless you're thinking scripting the phsyics itself Overseer_Prince 188 — 1y
0
You could just unanchor all the parts at the moment of destruction with a for loop. XxTrueDemonxX 362 — 1y
Ad

Answer this question