|
| 24 Jan 2016 07:27 PM |
function activated()
bar.Size = bar.Size + Vector3.new(0,10,0) end
function deactivated() bar.Size = bar.Size - Vector3.new(0,10,0) end
while true do activated() wait(10) deactivated() end
So 1) it isn't sliding through a brick that I want and it isn't decreasing the size back. |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2016 07:31 PM |
When you change the size, the game is going to reposition the part to avoid it colliding with other parts, so you'll need to cframe it to the correct spot every time you resize it.
Also, you have no wait between deactivate and activate |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2016 07:32 PM |
"When you change the size, the game is going to reposition the part to avoid it colliding with other parts, so you'll need to cframe it to the correct spot every time you resize it.
Also, you have no wait between deactivate and activate"
Wait so I have to use CFrame.new?
and I have a wait in the while true |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2016 07:34 PM |
You'll need to change the size like you are doing, and then also change the cframe at the same time to stop it from moving (I assume this is the issue you are talking about)
while true do activated() wait(10) deactivated() -- You need a wait here end
You do have a wait, but you don't have a wait between 'deactivated' and 'activated' (where I've added the comment). Since it's looping, after it calls 'deactivated' it will instantly go back to the start of the loop and call 'activated' again |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2016 07:37 PM |
| Thanks! and can you give me an idea for the cframe like an example code with the size? |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 24 Jan 2016 07:37 PM |
local function chng(val) bar.Size = bar.Size + Vector3.new(0,val,0) bar.CFrame = bar.CFrame + Vector3.new(0,val,0) end
while true do chng(10) wait(10) chng(-10) wait(10) end |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2016 07:45 PM |
I was more thinking something like
function activated() local cf = bar.CFrame bar.Size = bar.Size + Vector3.new(0,10,0) bar.CFrame = cf end
function deactivated() local cf = bar.CFrame bar.Size = bar.Size - Vector3.new(0,10,0) bar.CFrame = cf end |
|
|
| Report Abuse |
|
|