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

I am trying to connect bricks with a script, for my self parking car?

Asked by 6 years ago

I mean like this. http://prntscr.com/inbj7c The red in this represents a parking spot, and a car. The system automatically come up with a position for the blocks that are yellow and green.

I need a script that checks around for objects (I already have) and then determines a path that the car can follow in order to park near perfectly.

0
You mean welding? DeceptiveCaster 3761 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

If you're talking welding, try this:

function Weld(p1, p2)
    local w = Instance.new("Weld", game.JointsService)
    w.C1 = p1.CFrame:toObjectSpace(p2.CFrame)
    w.part0 = p1
    w.part1 = p2
end
Weld(script.Parent, script.Parent.Parent.Part2)
Ad

Answer this question