Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 tonygiang · Oct 10, 2018 at 02:59 PM · collisionparticlesparticlesystemparticle systemparticle collision

How to keep particles moving past an obstacle after they have collided with it?

I have this simple setup: a particle system firing at an obstacle with a collider. The particle system has Collision enabled, type is World, Bounce at 0. The scene looks like this: alt text

As you can see, the particles slide along the surface of the obstacle after the collision. What I'm trying to do is making the particles fly past the obstacle after they have slided off its surface. In other words, make the particle system behaves like air flow of some kind of gas or smoke. I think this image sort of illustrates my intended effect:alt text How do I do this in Unity?

2018-10-10-21-33-06-unity-2018211f1-personal-64bit.png (176.7 kB)
aerodynamics-car-1.jpg (21.0 kB)
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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by cailem02 · Oct 10, 2018 at 03:49 PM

Turn the collider component off hope this helped (I'm a noob sorry)

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 tonygiang · Oct 10, 2018 at 03:56 PM 0
Share

Unfortunately, this is not what I wanted. I don't want the particles to move through the obstacle. To others reading this comment: I want to make it very clear that cailem02's reply did not resolve my issue.

avatar image
0

Answer by richardkettlewell · Oct 13, 2018 at 05:57 PM

Use the velocity over lifetime module to set a constant velocity in the direction you want.

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 tonygiang · Oct 14, 2018 at 02:06 AM 0
Share

The velocity over lifetime module does not continue applying the particles' velocities after they collide. It seems that whatever constant velocity it applied to the particles was overridden by the collision module at the point the collision module calculates bounce (which in this case, Bounce = 0). So unfortunately, this is not the solution.

avatar image richardkettlewell ♦♦ tonygiang · Oct 17, 2018 at 08:19 AM 0
Share

you're right. I just tried it and it doesn't work, because the collision module negates the effect of the velocity module.

in addition to my previous suggestion, i think you could try adding a script to set the particle velocity to 0 via script each frame. i.e.(ps.GetParticles(particles), particles[i].velocity = Vector3.zero; ps.SetParticles(particles)). but if that doesn't work, i'm out of ideas...

avatar image
0

Answer by AlterHaudegen · Mar 08, 2020 at 04:57 PM

While searching for the same problem I came upon this post, in case anybody is doing the same: You can nowadays achieve the desired effect with Particle Force Fields.

Comment
Add comment · Show 8 · 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 tonygiang · Mar 08, 2020 at 07:27 PM 0
Share

I will not mark this as Accepted, unfortunately. Read further for a detailed reasoning.

  • In order to achieve something resembling the actual effect in my original post - i.e keeping particles moving past an obstacle after sliding off its surface - you have to supply a Texture3D that describes the flow of the particles in the Volume Texture field so that when particles move through the field, they slide along the surface of the obstacle before being pulled past the obstacle's surface, not immediately pulled toward the start range, not immediately repelled out of the end range.

  • This feature only supports 4 primitive shapes: Sphere, Hemisphere, Cylinder and Box. You cannot take the shape of a mesh directly or indirectly as the shape of the Particle System Force Field. The example of air flow sliding across the surface of a car mesh as seen in the original post is still not achieved with this method.

Particle System Force Field is ultimately meant to represent a field in empty space that either gravitates or repels particles. It is not meant to represent a solid object that particles in real life can slide past along its surface.

avatar image AlterHaudegen tonygiang · Mar 08, 2020 at 07:55 PM 0
Share

It should work in combination with the collision module of the particle system. I’ll try some experiments to be sure.

avatar image tonygiang AlterHaudegen · Mar 09, 2020 at 01:53 AM 0
Share

I know this (adding in a mesh collider) won't work because I have thought of it ahead of time and tried it myself. The inevitable thing that's going to happen as soon as particles collide with a collider is bounce is calculated and any existing velocity of the particles will be overridden. At its $$anonymous$$imum bounce value, the particles will slide across the surface of the mesh, but travel no further.

In a mesh more complex than any primitive shape provided by the Particle System Force Field, you will be forced to fake this effect by placing multiple Force Fields to pull particles past where they slide off the mesh's surface. This is inherently inaccurate, you have to deal with multiple Force Fields interfering with each other and this is multiple Force Fields per Particle System. If particles come in from another direction, they slide off the mesh's surface at different locations and need to be pull in a different direction, hence you have to set up another group of Force Fields. And because this fake effect relies on knowing where particles come from ahead of time, the illusion will break as soon as the particle system's position changes during runtime.

This is ultimately a solution to create a fake effect for something as straightforward as making particles behave like real air flow being blown against a solid surface.

Show more comments

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

154 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 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

Particle emission on particle collision 2 Answers

Which particle system does unity use? 0 Answers

How to detect which exact particle element from a particle system hit a collider? 0 Answers

Unity 2D Particle System's collider doesn't trigger other colliders for scripts. 0 Answers

How to make OnParticleCollision affect multiple GameObject 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