Hellooo, I have some cars that I would like to lerp to a certain position, but the thing is, the primary part that is being lerped is not welded to the rest of the car, the primary part is the FR wheel by the way, so I tried using weld constraints, however, this stops the car functioning and moving, so it doesn’t drive. The lerp happens on a touched event, the part being touched is called invispart, I’m on my phone right now, therefore, I can’t share the script, I will do that later, my question is: Do you know a way to weld(using weld constraints) every part in the model to the primary part ONLY once is touches the invispart and make the welds disappear once it reaches the destination?
This is optional but if you can, can you enlighten me as to how to make it so that it keeps the position on the z axis but changes only on the X and y axis, but you don’t have to. Reminder I will share the script later once I get on my pc
Thank you all!
Edit:
local invispart = script.Parent
invispart.Touched:Connect(function(hit)
if hit.Parent.Parent.Parent and hit.Parent.Parent.Parent:IsA("Model") then -- Some detecting to see if it's a car
hit.Parent.Parent.Parent.PrimaryPart.CFrame = hit.Parent.Parent.Parent.PrimaryPart.CFrame:Lerp(CFrame.new(100,100,100), 1)
`end`
end)
Things I’ve thought of so far, will they work? :
-
Manually create all weld constraints and disable them, then enable them in the event, then disable them once the car reaches its destination
-
Is there a way to Get All Children of a model and weld them to the primary part?