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

Is there anyway to move this? (moving part)

Asked by
roquick 41
6 years ago

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
im assuming you are using position, use cframe instead Vulkarin 581 — 6y

2 answers

Log in to vote
0
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

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)
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)) M39a9am3R 3210 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

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

Answer this question