Need help with connecting a block to 2 other ones without it resizing to the middle

Hey, I’m currently working on a system that detects the position of a block it touches, but I just can’t figure out how to avoid this!

The issue is, when sizing the sensor, it always resizes itself in the middle, and not connected to the car’s side. Anyone know how to resize the sensor to both be in the position of the thing it touches, and connected to the car?

Video:

Block I’m trying to resize is on the left side of the car

Script:

local Base = script.Parent.Base
local Find = script.Parent.Find

Find.Touched:Connect(function(hit)
Find.Size = Vector3.new(hit.Position.X - Find.Size.X ,Find.Size.Y,Find.Size.Z)
end)

PS: This is my first help forum. If I did not do anything right in the formatting, PLEASE tell me!

Maybe try:

local Base = script.Parent.Base
local Find = script.Parent.Find

Find.Touched:Connect(function(hit)
Find.Position = hit.Position
Find.Size = Vector3.new(hit.Position.X - Find.Size.X ,Find.Size.Y,Find.Size.Z)
end)

That would be if you want it to be resized on the brick that it touched.

If you want to make it move sideways toward the vehicle, then maybe try this:
When resizing it (for example by 1 stud) move it by 1 stud on the same axis.

I haven’t tried any of this so it may not work.

Hope this helps!

1 Like

Hey!
Thanks for responding, I’m trying this right now.

1 Like

I’ve just tried this, and another issue popped up. Now I just don’t know how to explain it.

Video:

Script:

--Made By Dorthsky
local Base = script.Parent.Base
local Find = script.Parent.Find
Find.Touched:Connect(function(hit)
	Find.Position = hit.Position
	Find.Size = Vector3.new(hit.Position.X - Find.Size.X ,Find.Size.Y,Find.Size.Z)
end)

I know what is making that mistake, but I’m trying to figure out how to fix it. All I can think of is moving it along an axis so it meets up with the vehicle, but I’m not exactly sure how you would do that.

1 Like

After giving up trying my best I decided to just use rays and it works GREAT! Thanks for your help!

1 Like