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 » Scripting Helpers
Home Search
 

Re: Can one create explosions without the fire effect?

Previous Thread :: Next Thread 
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
26 Nov 2012 09:48 PM
I'm currently creating a custom explosion using parts (right now it's a red sphere that expands, but I plan on expanding it). Using the parts by itself however, will not cause the unanchored parts to go flying. My first solution to this would be to include an explosion with a blastradius equal to the the size of the total animation and with a blastpressure great enough to blow away the parts. However, that brings back the issue of the normal explosion fire appearing. Is there a way to make that not appear?

If not, my second solution involves firing the touched event with the bricks in the animation and giving them a BydoVelocity, but this then introduces various checks that I'd not rather have to run every time it touches a brick (and due to the expansion, many touch events will fire), such as if it is anchored or already has one of the BodyVelocities in it.

If there is a way to do what was outlined in the first paragraph, or a better way to implement it than my idea in the second, please tell me. Thank you for your time.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Nov 2012 10:05 PM
Not sure, mine just Kills everything through Walls or if it has a "Vehicle" Value in it.
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
26 Nov 2012 10:10 PM
@thecaptain,
The sphere currently will kill players that touch it, but I would like to expand it so that it will blow away parts, like the original explosion.

Here's some of the relevant code, in case anyone cares. It shouldn't really affect the question, however.

function blow(hit, missile)
-- blah blah debounce system, sounds, etc.
-- creating explosion (cloning defined part earlier)
explode.Touched:connect(function(part, distance) onPlayerBlownUp(part, distance, creator) end)
explode.Parent = game.Workspace
for i=1, 30, 3 do -- yay expansion
explode.Size = Vector3.new(i,i,i) -- sphere formfactor works the rest out
explode.CFrame = cframe -- this cframe was determined when placed in map
wait()
end
explode:Destroy() -- might have explosion create small sphere trails as it dissipates later
wait(.1)
if missile then missile:Remove() end -- this needs to be moved before expansion
d = true
end

function onPlayerBlownUp(part, distance, creator)
-- killing players

-- here's the start of my work-around. not really sure how to use BodyVelocity, however.
-- will do some testing if can't get Explosions to work
--[[ if part.Anchored == false and part:FindFirstChild("bv") == nil then
bv = Instance.new("BodyVelocity", part)
bv.Name = "bv"
bv.maxForce = Vector3.new(100, 50, 75)
bv.velocity = Vector3.new(100,50,75)
bv.P = 50
end ]]
end

Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
26 Nov 2012 10:16 PM
The answer in one word: No.

You can recreate the effects of an explosion without the fire effect, but the explosion itself to my understanding has the same particle effect no matter what you do..
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
26 Nov 2012 10:23 PM
@swm,
How would I go about doing that? Is my original idea of inserting BodyVelocities into the bricks a decent idea that I just need to figure out how to do, or is there a better way to have the unanchored parts fly away? Maybe it should be a BodyForce instead of a BodyVelocity?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
26 Nov 2012 10:24 PM
It should probably be just setting their velocity properties, otherwise you have either a constant force on the object (despite the explosion having disappeared) forever, or the object moves at a constant velocity (despite the explosion having disappeared) forever.
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
26 Nov 2012 10:32 PM
Alright, that makes sense. However, I'm encountering anther problem. By changing the Velocity property of the brick, it is applying a force to other bricks that touch it (e.g. a player walking over it) instead of having it fly away. How do I get it to start moving?

(note: All I was doing right now is part.Velocity = Vector3.new(x,y,z))
Report Abuse
Solotaire is not online. Solotaire
Joined: 30 Jul 2009
Total Posts: 30356
26 Nov 2012 10:40 PM
Fixed it, I forgot to use BreakJoints. Thank you for your help!
Report Abuse
UndefinedScripter is not online. UndefinedScripter
Joined: 07 Oct 2012
Total Posts: 115
27 Nov 2012 06:08 AM
And if you are trying to kill a player with the explosion, try using magnitude.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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