Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I move a brick on the X axis without it going up?

I move a brick on the X axis, it works perfectly fine, but when it hits another brick, it moves up so that it's on top of the brick. I want it to go through the brick, how do I fix this? This is my script:

while true do
	wait(0.001)
	script.Parent.Position = script.Parent.Position + Vector3.new(0.275, 0, 0)
end

If you still don't know what I'm talking about, try this script yourself on a brick. Then put some parts in front of it. It will go on top of those parts once it hits them. I want the part to go through those other parts that it's running into.

7 comments

0

Could you elaborate please? Also, if you can, include an example.

0

edit has been posted.

0

... From what I can infer, you want your brick to continue moving Through Other Bricks on the x-axis?

0

yes.

0

"through other bricks" use CFrame instead of Position

0

how would i write my script if i used CFrame?

0

composed it as an answer

1 answer

✓ Accepted answer
local part = script.Parent
part.CFrame = CFrame.new(part.CFrame.X + 0.275. part.CFrame.Y, part.CFrame.Z)

Idk if there's a more efficient way of writing this but that should work

1 comment

2

part.CFrame = part.CFrame + Vector3.new(0.275,0,0) would be simpler.

This discussion is preserved as it was. New answers, comments, and votes are closed.