FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionParticle Modifier Script by BryceCain25

more_horiz
Hi!
today I have made a new particle modifier script...
this is basically just to show how to use the particle with variables..
if you press Up Arrow (using Keycode.UpArrow) you can increase the particle Size..
and vice versa
the thing is with this script, the Multiplier I may have messed up...to what I may be thinking is:
since 1*5 = 5, and -1*5 = -5, this case you would have the particle increase on a negative scale...which in match terms this seems really weird to have a negative scale for increasing integers..it works I guess...
It may seem extremely hard to get used to, so indeed I will rewrite a full script that people can use if they insist I do..


here is the script: (JavaScript, UnityScript)

Code:

var theparticle : Particle;
var multiplier : int;
var decrease : int;
var minimumenergy : int;
var minimumsize : int;
var maximumsize : int;
var maximumenergy : int;
function Start () {
theparticle.startEnergy = minimumenergy; //this will start the the particle system with
//the minimum energy possible...
theparticle.size = minimumsize; //this will start the particle system with the minimum size..
Check();
Checktwo();
}

function Update () {
if(Input.GetKeyDown(KeyCode.DownArrow)) {
theparticle.size = theparticle.size*multiplier;
}
if(Input.GetKeyDown(KeyCode.UpArrow)) {
theparticle.size = theparticle.size/multiplier;
}

}

function Check () {
if(theparticle.size == maximumsize) {
theparticle.size = minimumsize;
}
}


function Checktwo () {
if(theparticle.energy == maximumenergy) {
theparticle.energy = minimumenergy;
}
}


Thank you!

_________________
-BryceCain25

descriptionRe: Particle Modifier Script by BryceCain25

more_horiz
Very interesting! Thanks for the share Bryce.

descriptionRe: Particle Modifier Script by BryceCain25

more_horiz
Great share BryceCain25.

--New Developer

_________________
Serious, Focused but FUN.

descriptionRe: Particle Modifier Script by BryceCain25

more_horiz
[You must be registered and logged in to see this link.] wrote:
Very interesting! Thanks for the share Bryce.
Thank you! Very Happy

_________________
-BryceCain25

descriptionRe: Particle Modifier Script by BryceCain25

more_horiz
[You must be registered and logged in to see this link.] wrote:
Great share BryceCain25.

--New Developer
Thanks! Very Happy

_________________
-BryceCain25

descriptionRe: Particle Modifier Script by BryceCain25

more_horiz
Great Bryce Very Happy

_________________
Game Developer
YouTube Channel: [You must be registered and logged in to see this link.]
Website: [You must be registered and logged in to see this link.]

descriptionRe: Particle Modifier Script by BryceCain25

more_horiz
[You must be registered and logged in to see this link.] wrote:
Great Bryce Very Happy
Thank you!

_________________
-BryceCain25
Permissions in this forum:
You cannot reply to topics in this forum