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
 

Re: [Q] How do you change the size of a welded brick?

Previous Thread :: Next Thread 
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
01 Jul 2015 05:15 AM

So, yea the question may be dumb and can easily be solved using CFrame, but it looks bad!

Let's use this script:

p = Instance.new("Part", game.Workspace)
p.Anchored = true
p2 = Instance.new("Part", p)
p2.CFrame = p.CFrame*CFrame.new(0,10,0)
local weld = Instance.new("Weld",p2)
weld.C0 = p.CFrame:inverse()
weld.C1 = p2.CFrame:inverse()
weld.Part0 = p
weld.Part1 = p1

while wait(0.2) do
p2.Size = p2.Size+Vector3.new(0.1,0.1,0.1)
end

the brick would fall, so how do i fix that without using CFrame?
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
01 Jul 2015 09:56 AM
bump#1
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
02 Jul 2015 04:41 PM
I see i can't get helped ;(
Report Abuse
Narutozo is not online. Narutozo
Joined: 28 Jul 2013
Total Posts: 1314
02 Jul 2015 04:44 PM
p = Instance.new("Part", game.Workspace)
p.Anchored = false
p2 = Instance.new("Part", p)
p2.CFrame = p.CFrame*CFrame.new(0,10,0)
local weld = Instance.new("Weld",p2)
weld.C0 = p.CFrame:inverse()
weld.C1 = p2.CFrame:inverse()
weld.Part0 = p
weld.Part1 = p2

while wait(0.2) do
p2.Size = p2.Size+Vector3.new(0.1,0.1,0.1)
end
p1 doesnt exist
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
02 Jul 2015 04:45 PM
Well that's not the problem, the problem is that the brick falls ;3;
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
02 Jul 2015 04:46 PM
I need to know also D:
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
02 Jul 2015 04:46 PM
Wait nvm, what the hell are you saying? There's no variable called "p1". Did you read it before replying?
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
02 Jul 2015 04:53 PM
I wonder if someone knows it Q-Q
Report Abuse
Narutozo is not online. Narutozo
Joined: 28 Jul 2013
Total Posts: 1314
02 Jul 2015 04:56 PM
exactly
you welded it to p1
p1 is nil
p1 doesnt exist.
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
02 Jul 2015 04:59 PM
oh lol just noticed that, however that's not the acutal script! This is just to give an idea of what i'm having trouble.

The question is: How do you change size/position of a Instance that is welded to a brick without using CFrame?
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
02 Jul 2015 05:12 PM
You have to re-weld it afterwards, which just means store the weld before you resize, then re-attach the Part0 and Part1

local function ResizeWithWeld(part, weld, size)
local p0 = weld.Part0
local p1 = weld.Part1
local parent = weld.Parent
part.Size = size
weld.Part0 = p0
weld.Part1 = p1
weld.Parent = parent
end

~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~
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