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

Is there anyway to move this? (moving part)

Trying to move a brick under a roof using a script but it keeps being placed above the roof, is there any method to move it properly?

1 comment

1

im assuming you are using position, use cframe instead

2 answers

You are probably doing something like this to move the part:

part.Position = part.Position + Vector3.new(3,0,0)

But when you directly change the Position property, the part is automatically moved upwards until it is not colliding with anything else. To fix this, you should change its CFrame instead:

part.CFrame = part.CFrame + Vector3.new(3,0,0)

1 comment

0

Can't Add Vector3 to CFrame. Can't perform addition with CFrame. CFrames are matrices the only way to add to them is by multiplying them. Try part.CFrame * CFrame.new(Vector3.new(3,0,0))

find the exact locatoin you want to change it to then do vector.new

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