I am trying to make a brick that grows and kills you if you touch it, but I'm having a problem with Vector3.new() making it so if I walk into it, the part goes above me. Can you tell me why? BTW the part has CanCollide set to false, but I believe the problem is with the touchinterest that the kill script creates.
✓ ANSWER ACCEPTED
Problem with Vector3 and size?
1 answer
✓ Accepted answer
Every time you try to change the size of the part, it changes its position so that it doesn't intersect (collide) with another part. To make the part stay in place, simply reset its CFrame every time you resize it. Simply resetting its Position would not do.
local part = script.Parent -- the part itself
local origcf = part.CFrame -- original CFrame of the part
--TO-DO: The rest of the script
function grow() -- function that grows the block
while wait() do
--TO-DO: Increase the size of the part every iteration of the loop
part.CFrame = origcf -- reset the CFrame of the part every iteration
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
