FP_Nation
(FP_Nation)
October 18, 2022, 2:19am
#1
Hello, today I’ve ran in to an issue. I’m tweening a part’s position and while it’s being tweened I’m trying to weld another part to it. I made the “another” part unanchored, however when I do this process my “another” part is stuck in the same place even though it’s been welded to the part using “WeldConstraint”. Is this a engine bug or a feature? If any of you know how to resolve this issue, please let me know! Thanks!
SelDraken
(SelDraken)
October 18, 2022, 2:31am
#2
It works for me, I am able to tween parts with other parts connected.
Check out my reply on this post, in the example place, the doors are tweening the inner frame, while the rest of the door parts are using a weld constraint to stay connected.
I went ahead and just made a sliding door. I had only done rotating doors before, so this was a nice learning experience.
AutomaticSlidingDoor.rbxl (41.4 KB)
[image]
[image]
local openDistance = 4 --how many studs the door will slide open
local speed = 1 --time for the door to open or close
local isOpen = false -- makes sure we wait until door is fully open before closing
local hitTable = {} --holds the id's of players that are standing in the hit box
local hitBox = script.Parent:WaitFor…
FP_Nation
(FP_Nation)
October 18, 2022, 3:08am
#3
The “cake” is anchored. The brown thing isn’t. Everything is welded.
Explorer:
Properties:
Behavior:
1 Like
SelDraken
(SelDraken)
October 18, 2022, 3:10am
#4
Can you show the code where you are actually creating the weld for the icing to be on the cake?
SelDraken
(SelDraken)
October 18, 2022, 3:14am
#6
And can you show the code where the cake is being tweened along the conveyor?
The reason I ask, is that I am trying to duplicate this to see if I get the same results or if I can see a way to prevent the icing from sticking
If you use CFrame to tween instead of position it would drag the unanchored welded part with it:
Roblox handles moving a welded part differently depending on whether the part was moved using its Position or with its CFrame .
If a welded part’s Position is updated, the part will move but none of the connected parts will move with it. The weld will recalculate the offset from the other part based on the part’s new position.
In contrast, if a part’s CFrame is updated, that part will move and any part welded to that part will also move. These other parts will be moved to make sure they maintain the same offset as when the weld was created.
3 Likes
SelDraken
(SelDraken)
October 18, 2022, 3:27am
#9
@VegetationBush is correct, you need to use CFrame instead of Position
Good catch.
SelDraken
(SelDraken)
October 18, 2022, 3:54am
#10
I got it working, but only after I turned Frosting to massless
Cake and Conveyor.rbxl (38.6 KB)
FP_Nation
(FP_Nation)
October 18, 2022, 3:59am
#11
I got it working as well, thanks for your help.
SelDraken
(SelDraken)
October 18, 2022, 4:00am
#12
No problem, best of luck on your project.
1 Like