Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by QFSW · Sep 24, 2017 at 06:09 PM · physicsparticlesystemshuriken

Shuriken: Make Particle System Completely Scale

Hi all, I've got a bit of an issue. In my game I need my entire map to be able to scale up or down, this means the particle systems do too. Some are local and some are world space. Is there any way to make it so that the same system scaled 10x as big would look exactly the same as the original but 10x the size? this means the velocities, gravity, dampening etc would also scale

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ifurkend · Sep 25, 2017 at 05:55 AM 0
Share

Ins$$anonymous$$d of scaling the whole thing, I think it would be easier to move your rendering camera closer to /farther from the map (perspective) or change the camera size (orthographic), this way you don't need extra script to manually scale the particle system parameters which aren't automatically scaled with transform.scale.

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by QFSW · Sep 25, 2017 at 07:02 AM

Here's a start. It wont cover everything, but should get people started. Any time you notice a param that doesn't scale you'll need to add it. (Also use hierarchy scaling mode).

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class ParticleSystemScaler : MonoBehaviour
 {
     private ParticleSystem ThisSystem;
     private ParticleSystem.MainModule ThisMain;
     private ParticleSystem.NoiseModule ThisNoise;
     private ParticleSystem.LimitVelocityOverLifetimeModule ThisLimitVelocity;
 
     private float CurrentScale;
 
     private float InitialGravity;
     private float InitialNoiseStrength;
     private float InitialNoiseFrequency;
     private float InitialMaxVelocity;
 
     private void Start()
     {
         Initialise();
         ResizeSystem(transform.lossyScale.x);
     }
 
     private void Initialise()
     {
         ThisSystem = GetComponent<ParticleSystem>();
 
         if (ThisSystem)
         {
             ThisMain = ThisSystem.main;
             ThisNoise = ThisSystem.noise;
             ThisLimitVelocity = ThisSystem.limitVelocityOverLifetime;
 
             InitialGravity = ThisMain.gravityModifierMultiplier;
             InitialNoiseStrength = ThisNoise.strengthMultiplier;
             InitialNoiseFrequency = ThisNoise.frequency;
             InitialMaxVelocity = ThisLimitVelocity.limitMultiplier;
         }
     }
 
     private void ResizeSystem(float NewScale)
     {
         CurrentScale = NewScale;
 
         if (ThisSystem)
         {
             ThisMain.gravityModifierMultiplier = InitialGravity * NewScale;
             if (ThisMain.simulationSpace == ParticleSystemSimulationSpace.World)
             {
                 ThisNoise.strengthMultiplier = InitialNoiseStrength * NewScale;
                 ThisNoise.frequency = InitialNoiseFrequency / NewScale;
                 ThisLimitVelocity.limitMultiplier = InitialMaxVelocity * NewScale;
             }
         }
     }
 
     private void Update()
     {
         if (transform.lossyScale.x != CurrentScale) { ResizeSystem(transform.lossyScale.x); }
     }
 }
 

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by IgorAherne · Sep 25, 2017 at 06:14 AM

You can scale particles with their parent

http://answers.unity3d.com/answers/621713/view.html

Not sure if it will affect the gravity etc though

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image QFSW · Sep 25, 2017 at 06:25 AM 1
Share

From what I can see, at least some of the physics is not scaled properly

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple trails behind one particle? 1 Answer

PS Custom Vertex Streams to Particle Trail 0 Answers

Shuriken "Distance" emission mode not working 1 Answer

ParticleSystem.Stop or particleEmitter.enabled = false; 1 Answer

Why is Shurikan particle system variable textureSheetAnimation scripting not recognised? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges