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 The_Least · Feb 18, 2015 at 06:06 AM · particles

Can shuriken Particles be affected by LateUpdate animation?

I have a fire-breathing monster whose head transform is being set in LateUpdate (courtesy of FinalIK's AimIK and LookAtIK functions). I'm currently using shuriken particle emitters, childed to the head joint, to create a flamethrower effect. However the particle systems emit their particles before LateUpdate, meaning that they don't take FinalIK's procedural animation into account.

If I set emission to Local space, the problem is barely noticeable, as the flames only lag one frame behind the slow-moving head, but if I set it to World, the emitters ignore the procedural head transform and send flames out at completely the wrong angle.

Using IK to aim my monster's attacks is integral to my gameplay, but I want the flame particles to exist in World space so they behave more realistically than the perfectly straight ray that Local space produces. Is there any way to make Shuriken particles take LateUpdate transforms into account, or should I start looking at alternate particle systems?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Partel-Lang · Oct 21, 2015 at 07:41 AM

Hey,

Let's say you wanted to have a ParticleSystem that emits steam from one of the character's ears. Set up the ParticleSystem to the position of the ear, but don't parent it to the head. Make an empty gameobject instead, name it "Target" and put it to the exact same position and rotation and parent the Target to the head instead. Then add this script to the ParticleSystem gameobject:

 public Transform target; // The Transform parented to one of the character's bones

 private Vector3 targetPosition;
 private Quaternion targetRotation;

 void Start() {
     LateUpdate();
 }

 // Move this ParticleSystem to the target's last frame position before it emits
 void Update() {
     transform.position = targetPosition;
     transform.rotation = targetRotation;

 }

 // Read the world space position and rotation of the target after procedural effects have been applied
 // NB! Make sure this script is set to a higher value than FinalIK components in the Script Execution Order!
 void LateUpdate() {
     targetPosition = target.position;
     targetRotation = target.rotation;
 }


NB! Make sure this script is set to a higher value than FinalIK components in the Script Execution Order!

Cheers, Pärtel

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 CodeMasterMike · Feb 18, 2015 at 06:49 AM

The world vs local space simulation is only used for moving and rotating the particles. The particles do exist in, and interact with, the world regardless which of these simulation options you use.

Using world simulation, then the particle uses the global coordinate system (i.e. y-axis is always up). Using local simulation, then the particle uses the local coordinate system, which can differ depending on the object/parent object (i.e. the y-axis doesn't always have to point up as with the world space).

Comment
Add comment · Show 3 · 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 The_Least · Feb 19, 2015 at 01:57 AM 0
Share

Thanks, but I understand the difference between world and local simulation space. $$anonymous$$y question is whether it's possible to emit particles taking LateUpdate animations into account.

avatar image CodeMasterMike · Feb 19, 2015 at 11:09 AM 0
Share

As far as I know, you can't change when the particles are updated internally.

One way you could do it, is that you emit, update (position and rotation and whatnots) all the individual particles yourself in the LateUpdate method, ins$$anonymous$$d of using the internal ParticleSystem update.

avatar image The_Least · Feb 20, 2015 at 08:33 AM 0
Share

Build my own particle system? Eek, no, I'm too lazy for that. Ins$$anonymous$$d I've created a script that aligns the emitter to the joint in LateUpdate, and I've set the script to execute after the FinalI$$anonymous$$ scripts. It still lags a frame behind, but otherwise works as intended.

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

Random 2d particles in Particle_system from spritesheet 1 Answer

What's the best way to stop particles? 1 Answer

VertexLit particles not affected on all directions 0 Answers

Aura - PLZ HELP 0 Answers

Very strange particle question. 0 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