C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 17 Aug 2016 02:46 PM |
| So like. When this brick "explodes" I want to spawn several different bricks, but I want it to come out like a circle around the main brick. Then, those bricks travel in the directions they're facing. Idk how to do this though. :/ |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
| |
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 17 Aug 2016 03:45 PM |
for 1 = 1, math.random(10, 15) do local part = Instance.new("Part", workspace) --customize the part here part.Position = brick.Position local direction = Vector3.new(math.random(1, 100), math.random(1, 100), math.random(1, 1000)).unit Instance.new("BodyForce", part).Force = direction*40
--check for typos |
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 17 Aug 2016 03:50 PM |
| Thanks for the post, but I mean I want to create parts that surround the main part in a circle formation. I remember some tutorial on the wiki about this but I forgot it. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2016 04:07 PM |
| that lags, also just draw cframes in angles around it or clone a base explosion model onto it |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2016 04:13 PM |
blarg i do that and it works good
here's the cheap, easy way to do it(i do this with my enemies)
you have an explosion model
you clone it into workspace and position it to the part when it dies
then apply a body force and set its force equal to the lookvector of the part*100 or something
when you make the model rotate the parts to your need
Formerly xXTheRobotXx, add 13,349 posts |
|
|
| Report Abuse |
|
|
2eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 1351 |
|
|
| 17 Aug 2016 04:16 PM |
local n = 15 for i = 1, n do local angle = 2*math.pi*i/n local v = Vector3.new(math.cos(angle),0,math.sin(angle)) local part = Instance.new('Part', workspace) part.CFrame = CFrame.new(brick.Position, brick.Position + v) Instance.new("BodyForce", part).Force = v*40 end
|
|
|
| Report Abuse |
|
|
C_Sharper
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 6405 |
|
|
| 17 Aug 2016 04:17 PM |
| That's kinda cool Narwhal. And thanks blarg, I will try that! |
|
|
| Report Abuse |
|
|