|
| 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 |
|
|
| |
|
|
| 02 Jul 2015 04:41 PM |
| I see i can't get helped ;( |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 02 Jul 2015 04:45 PM |
| Well that's not the problem, the problem is that the brick falls ;3; |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 02 Jul 2015 04:53 PM |
| I wonder if someone knows it Q-Q |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|