Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2167
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Particle Modifier Script by BryceCain25

on Sun Oct 26, 2014 12:39 pm
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!
avatar
Admin
Admin
Posts : 608
Points : 3195
Rep : 406
Join date : 2013-12-11
Age : 21
View user profilehttps://www.youtube.com/user/misterninjaboy

Re: Particle Modifier Script by BryceCain25

on Sun Oct 26, 2014 1:49 pm
Very interesting! Thanks for the share Bryce.
avatar
Moderator
Moderator
Posts : 194
Points : 2019
Rep : 44
Join date : 2013-12-30
View user profile

Re: Particle Modifier Script by BryceCain25

on Sun Oct 26, 2014 1:54 pm
Great share BryceCain25.

--New Developer
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2167
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Particle Modifier Script by BryceCain25

on Sun Oct 26, 2014 4:47 pm
MisterNinjaBoy wrote:Very interesting! Thanks for the share Bryce.
Thank you! Very Happy
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2167
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Particle Modifier Script by BryceCain25

on Sun Oct 26, 2014 4:47 pm
NewDeveloper wrote:Great share BryceCain25.

--New Developer
Thanks! Very Happy
avatar
Moderator
Moderator
Posts : 329
Points : 2202
Rep : 43
Join date : 2014-03-12
Age : 18
Location : Italy
View user profilehttp://masterdevelopers.altervista.org/

Re: Particle Modifier Script by BryceCain25

on Tue Oct 28, 2014 12:54 pm
Great Bryce Very Happy
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2167
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Particle Modifier Script by BryceCain25

on Sun Nov 09, 2014 6:02 pm
developer23 wrote:Great Bryce Very Happy
Thank you!
Back to top
Permissions in this forum:
You cannot reply to topics in this forum