I am currently trying to make a placement system for fun and want to create walls that link up with each other. I’ve been having basically no trouble up to this point but I would want to do it similarly to how the counter system works in Welcome to Bloxburg.
I was thinking I could cast two rays, each part from the RightVector of each wall but I don’t know how I’d find the intersection.
For my idea, I was thinking I could cast two rays, one from each part but as I said in the title, I don’t know how to get the intersection between the two rays.
you need to take the Z axis from the first part and the X axis from the second one or the inverse
your script should be like this:
local Part1 = game.Workspace.Part1
local Part2 = game.Workspace.Part2
local intersection = Vector3.new(Part2.Position.X,Part1.Position.Y,Part1.Position.Z)|
local Part = Instance.new("Part")
Part.Parent = game.Workspace
Part.Position = intersection
Took a read, I don’t know if it’s what I am looking for as if I cast a ray, there may be an object in the way which would mess up the calculations as I don’t really want a line per se, only a ray. Unless that could work but I don’t know. I am also not the best in math and have no idea how it works.
@Brickman808,
So I would just cast a ray from the desired face, in the direction of the part labelled as “A”?
@NarakuLite,
I think this may work but I might run into some issues with direction and whatnot when not working with 90º angles. I’ll still try it out though.
I will take a shot at all three of your methods and report back.
@Brickman808,
Partially the same reason as below (working with acute angles). If I were to cast a ray, it wouldn’t give the desired effect unfortunately.
@NarakuLite,
Your idea did kind of work when working with 90º angles but trying to experiment with other angles results in this issue when 2 of the axes are the same, the result is not what I was looking for unfortunately.