playMaker

Author Topic: Scaling the effect of a particle system  (Read 5148 times)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Scaling the effect of a particle system
« on: November 19, 2013, 07:19:15 AM »
I have 2 particle effects for weather in my game, snow and rain. They both look very nice. The snow should kick in when the player reaches a certain height on the terrain, therefore it rains in the valleys, and snows on the mountain. I set it up that one rain is disabled when the players transform reaches a certain height, and the snow is ENabled.

However the effect is too harsh a switch and I realise I need some kind of crossfade from one to the other. I was hoping that at the switch point, some remaining particles would "rain down" before it becomes the other, but it doesn't of course, it just turns them straight off.

My question is in 2 parts:

Q1. Which parameter on a particle system can be used to adjust an effects from Max to Min? and
Q2. How, can I scale this parameter based on height.


Mark

PS: I apologise that this is a cross post from Unity Answers, as I have the generic question about particle systems (Q1) that is maybe more relevant to post there.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Scaling the effect of a particle system
« Reply #1 on: November 19, 2013, 07:26:20 AM »
You could have a blend gap between the two heights and scale the actual size of the particles in the system.

ie when you reach a height of 1000 the Snow is turned on, and particle size set to 0. At the same time the Rain particle size goes from full to 0 between height 1000 and 1100 while the Snow particle size scales up, from 0 to full height between 1000 and 1100 height.

So basically you can do a Set Property on the Particle Size of the Shuriken System Component every frame that does some math to compute the necessary size of particles based on the player height between 1000 and 1100.

Think that would work?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Re: Scaling the effect of a particle system
« Reply #2 on: November 19, 2013, 07:48:51 AM »
Maybe.. I think I get you Lane.. thanks.

It seems quite tricky to set up, but sensible. I think the parameter I need to adjust is actually Emission rate, rather than size. I think Size would change the visual look of the particles, whereas rate would just produce less (or more).

I may struggle with the maths though...

:)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Scaling the effect of a particle system
« Reply #3 on: November 19, 2013, 07:57:40 AM »
Yeah, Emission Rate would probably work better.

It may be a little tricky and the depending on the numbers it could be difficult but if you divide the values down to more simple and usable values it may not be so daunting. It will just take some experimenting.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D