Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

Properties of explosion?

Asked by 8 years ago

I would like to know what these properties are so I could use them in scripting, I only know one which is BlastRadius.

1 answer

Log in to vote
2
Answered by 8 years ago

Well the Property types are as follows:

Blast Pressure (Floating Value) -It determines the force applied on an object within the Blast Radius. It diminishes as you get farther away from the origin of the explosion.

Blast Radius (Floating Value) -Radius of the explosion in studs. Because it is a radius, if you wanted an explosion with a diameter of 5 you'd have a radius of 2.5. Because explosions cast out in a sphere the radius might need to be extended out a little past your intended value as the Cross-Section of a sphere gets smaller the higher up and lower down you go from it's origin.

DestroyJointRadiusPercent (Floating Value between 0 and 1) -This determines how close to the origin you have to be for an explosion to break the joints of an object. Say it was set to .5, an explosion with a BlastRadius of 100 would only break joints in the inner 50 studs. If you want an explosion to kill/destroy everything it could possibly effect, set the value to 1, if you want an explosion to not Break Joints or simply want an explosion to "flick" the players around, the value can be set to 0.

Explosion Type (Explosion Type Value - Enums 0-2) -This one requires reading from the wiki to understand the values. This effects how an explosion interacts with Terrain in your game.

0 - No Craters 1- Craters 2- Craters and Debris (My best guess for debris is that it either creates a particle effect out of the terrain type, or it's the effect that can leave the little dots of terrain left behind)

Position (Vector3 Value)- Sets the point the explosion will be in the Workspace using Vector3 to construct an (x,y,z) Coordinate position.

explosion = Instance.new("Explosion", workspace)
explosion.Position = Vector3.New(0,5,0) --Creates an explosion 5 studs above the origin

You then have the basic properties of about any object left. Archivable (bool) ClassName (String)- [Read-Only] Prints the unique name of the TYPE of the instance Name (String) - A non-unique identifier for the object Parent (Instance) -Sets the parent the explosion will be of in the hierarchy of your game.

When spawning in an explosion it's important to set the parent of the explosion to somewhere within workspace so it appears and explodes. It can be done multiple ways as such:

explosion = Instance.new("Explosion", workspace) --Where we use the second argument after the comma (,) to set the Parent of the explosion to workspace which is the global variable for game.Workspace
explosion.Parent = workspace --Does the same as above using the variable tied to the explosion to set it's parent

I hope these gave you an in-depth look on the properties of explosions. A lot more info can be found here http://wiki.roblox.com/index.php?title=API:Class/Explosion

~MBacon15

Ad

Answer this question