Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Souvik · Jul 18, 2014 at 04:25 PM · androidparticle system

I am trying to control a Particles System via scripting, it gives me the desired effect in the editor, but not so much on an Android device. Help!!

 #pragma strict
 var ninga1: GameObject;
 
 function Start () {
 
 }
 
 function Update () {
 
         if(Input.GetKeyDown(KeyCode.M)) {
             particleSystem.Play();
         }
     transform.position.x= ninja1.transform.position.x;
 
 }
 
 the above code works fine in the editor., but when I update my code to following,
 
 #pragma strict
 var ninja1: GameObject;
 
 function Start () {
 
 }
 
 function Update () {
 
     for(touch in Input.touches)
         if(touch.tapCount==3) {
             particleSystem.Play();
         }
     transform.position.x=ninja1.transform.position.x;
 
 }

the particles emit for a couple of times, maybe a few more times (sometimes), then that's it. Any kind of assistance would be apprciated. By the way, I had attached the above script to a Particle System in the Hierarchy.

Comment
Add comment · Show 2
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 robertbu · Jul 18, 2014 at 04:26 PM 0
Share

For future posts, please select your code after pasting it into the question and use the 101/010 button to format. I did it for you this time.

avatar image Souvik · Jul 18, 2014 at 05:32 PM 0
Share

thank you @robertbu.,I will keep that on my $$anonymous$$d,.

2 Replies

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

Answer by Souvik · Jul 19, 2014 at 08:04 PM

Well.,I figured it out.,all i had to do was apend particleSystem.Simulate(0.0); to the code. Now, works wonderfully well.

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 Xtro · Jul 18, 2014 at 08:45 PM

Why are you looping for touches ? Remove the for loop and just keep the if.

Comment
Add comment · Show 2 · 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 Souvik · Jul 19, 2014 at 02:40 PM 0
Share

thank you @Xtro for ur comment, but the problem still persists.,by the way, i removed the for loop and updated the if to,

 if(Input.touchCount==2)
         particleSystem.Play();


Is this what you were talking abt??

avatar image Souvik · Jul 19, 2014 at 02:47 PM 0
Share

okay.,my bad.,i see what i did there.,i added "Input.touchCount".,but it means if I touch the screen with two fingers simultaneously, the particle system should play, right? it does though, but only for a couple of times like before. Is there some setting in the "Particle System" that i could be missing?

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Gems shine effect (particle system ) reducing my performance. 2 Answers

Kindle Fire, Particle System 0 Answers

Particle System not working properly on Android 0 Answers

Particle System glitch on Android phone. 0 Answers

How do particle systems update? 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