• 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 Braddas · Jun 10, 2013 at 01:12 PM · shuriken

Shuriken - Any idea what causes '!CompareApproximately (SqrMagnitude (axis), 1.0F)' error when switching to mesh particles?

Hello, I tried posting this on the Unity forums but thought this might be the better place to ask.

I'm manually adding particles to a Shuriken emitter in a similar way to the tutorial here: http://catlikecoding.com/unity/tutorials/graphs/

This works fine with normal billboard particles, but I when I try to switch to mesh particles I get the following error:

!CompareApproximately (SqrMagnitude (axis), 1.0F)

Any ideas why this might be? I need to use meshes as I'm using Shuriken to render clouds, and billboards don't really look great once you get close to them. It's possible I'll have to fall back to the legacy particle system, though that doesn't render mesh particles by default, as far as I know.

I've uploaded a sample project that illustrates the problem here: Sample Project (Dropbox)

Once you hit play, you should get the error message (quite a lot will come through, I think it's per particle, per frame). If you switch the particle renderer to one of the billboard types it's fine though.

Comment
Add comment
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

1 Reply

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

Answer by Braddas · Jun 13, 2013 at 06:52 PM

Okay, I managed to work around this. I enabled the emitter and set it to emit a single mesh particle. My script waits for the particle to appear (when particleSystemObj.GetParticles(particles) > 0), then it switches the emitter off. It then sets a sourceParticle variable to the particle that was just created by the emitter. Whenever my script creates new particles it first sets each one to equal sourceParticle, essentially duplicating the original. After that I can modify it however I want, without any errors.

I'm not sure if this is a bug, or if you just aren't supposed to create particles without an emitter, but hopefully this will help somebody else too.

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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

14 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

Related Questions

Changing sub emitter via script? 1 Answer

Accessing Shuriken particle system values through a script in C# 3 Answers

How do I create a Shuriken moving particle system? 0 Answers

Scripting Shuriken 1 Answer

Can I force Shuriken to recalculate its bounds properly after using SetParticles() ? 2 Answers


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