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

Touched a brick?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

When I touch the part the part moves up so thats why I made a position.

x = script.Parent

x.Touched:connect(function()

    x.Size = x.Size + Vector3.new(1,1,1)
    x.Position.Vector3.new = -8, -1, -3 --Once it grows when you touch it, the part moves up so thats why I put this line there. So it can go back to its position.
end)

2 answers

Log in to vote
1
Answered by 8 years ago

Vector3 makes it not collide with any parts change it to CFrame for it to work

x.CFrame = CFrame.new(-8,-1,-3)
Ad
Log in to vote
2
Answered by 8 years ago

Whoa whoa whoa. This is wrong. Too wrong. The wiki. Readd the wiki!!!!

If you reference the wiki, you would've found this

workspace.Part.Position = Vector3.new(0, 50, 0)

So, for your part, we would do this...

x.Position = Vector3.new(-8, -1, -3)

But this shouldn't work. Why? Position is like the size you did. it offsets the position if it collides with a part. So we will have to use CFrame, that allows parts to collide with other parts and not be offsetted.

x.CFrame = CFrame.new(-8, -1, -3)
0
It does not move back to that position. FiredDusk 1466 — 8y

Answer this question