generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Vector3.new issue

Previous Thread :: Next Thread 
iamsmartcookie is not online. iamsmartcookie
Joined: 18 Aug 2012
Total Posts: 2738
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
0supadude0 is not online. 0supadude0
Joined: 11 Aug 2010
Total Posts: 649
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
iamsmartcookie is not online. iamsmartcookie
Joined: 18 Aug 2012
Total Posts: 2738
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
0supadude0 is not online. 0supadude0
Joined: 11 Aug 2010
Total Posts: 649
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
iamsmartcookie is not online. iamsmartcookie
Joined: 18 Aug 2012
Total Posts: 2738
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 is not online. 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
0supadude0 is not online. 0supadude0
Joined: 11 Aug 2010
Total Posts: 649
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image