|
| 23 Jul 2015 02:50 PM |
I've made a bomb that creates a sphere which expands over like 8 seconds, however this sphere appears far above the bomb itself, and refuses to collide with any blocks.
The block expands with a loop by adding to a Vector3. What do I need to be doing? |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 04:34 AM |
Bump and here's a diagram to explain what I mean. The "No" is what's happening right now, the "Yes" is what needs to be happening.
http://prntscr.com/7we4i6 |
|
|
| Report Abuse |
|
|
Fabunil
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4325 |
|
|
| 24 Jul 2015 05:43 AM |
You probably just added the Vector3 directly to the blocks Position. Use CFrame instead:
block.CFrame = block.CFrame + yourVector |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 12:37 PM |
| Nope, tried that, nothing. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 12:41 PM |
You should post the code so we can directly see/edit it..
Anchor the growing part.
local StartCF = Part.CFrame -- Outside loop Part.CFrame = StartCF -- Inside loop |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 01:19 PM |
local part = Instance.new("Part",workspace) part.Anchored = true part.Transparency = .5 part.CanCollide = false part.CFrame = bomb.CFrame - Vector3.new(0,50,0) part.TopSurface = "Smooth" part.BottomSurface = "Smooth" part.BrickColor = BrickColor.new("Bright orange") part.Shape = "Ball" spawn(function() for i = 1,200 do wait(.025) part.Size = part.Size + Vector3.new(4,4,4) end wait() part:Destroy() end) |
|
|
| Report Abuse |
|
|
Fabunil
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4325 |
|
|
| 24 Jul 2015 01:48 PM |
local part = Instance.new("Part",workspace) part.Anchored = true part.Transparency = .5 part.CanCollide = false part.CFrame = bomb.CFrame - Vector3.new(0,50,0) part.TopSurface = "Smooth" part.BottomSurface = "Smooth" part.BrickColor = BrickColor.new("Bright orange") part.Shape = "Ball" local cf = part.CFrame spawn(function() for i = 1,200 do wait(.025) part.Size = part.Size + Vector3.new(4,4,4) part.CFrame = cf end wait() part:Destroy() end)
Also, please note that wait(.025) will always wait for more than .33 seconds, depending on the amount of lag in your game you may get erratic results. |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 10:53 PM |
| So if I'm understanding correctly, the cf = part.CFrame inside of the loop is basically resetting the cframe every time it repeats to make it stay in the same place, since increasing the size will make it move elsewhere? |
|
|
| Report Abuse |
|
|
Fabunil
|
  |
| Joined: 25 Oct 2013 |
| Total Posts: 4325 |
|
| |
|
|
| 25 Jul 2015 07:39 PM |
add html
Hail The Master Language |
|
|
| Report Abuse |
|
|