• 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 Ryujose · Jan 22, 2015 at 11:09 PM · colliderplayerparticlesdetectionshoot

How to detect a collider in a particle?

Hello community.

I need to know how I can collide a particle with a GameObject with some detection collider added on it.

Example:

I've an enemy who's shoot is a constant particle. And I need to collide it on my player.

I'm completely lost, what method can I use?

Thanks in advance.

Regards.

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 khos85 · Jan 22, 2015 at 11:18 PM 0
Share

I think you can set the simulation space option to world space not local space, then it will work, also enable collision and set the parameters there, all of these things I refer to are for the particle system. Hope that helps

avatar image khos85 · Jan 22, 2015 at 11:21 PM 1
Share

I made a quick video for you, see youtube link:https://www.youtube.com/watch?v=oZ5rAo$$anonymous$$j7cA&feature=youtu.be

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by hav_ngs_ru · Jan 22, 2015 at 11:17 PM

http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnParticleCollision.html

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
1

Answer by cdrandin · Jan 22, 2015 at 11:18 PM

How complex is the particle? Can it be characterized as a ray? Don't try to do collision per particle that is being emitted. That is completely overkill!

Rather incase your particle in some basic primitive collider. If you only care about direction collision use a Ray, if you care about linear spatial collision use a capsule. Just play with which geometry suits your needs.

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
1

Answer by DanSuperGP · Jan 22, 2015 at 11:19 PM

Assuming you're using a Shuriken Particle System, you would use OnParticleCollision.

http://docs.unity3d.com/ScriptReference/MonoBehaviour.OnParticleCollision.html

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 Ryujose · Jan 24, 2015 at 03:46 AM

I've done some checks with documentation and it doesn't Works.

The thing I'm trying to do is:

I've a group of particles in one particle system. Those particle systems are shooted by an enemy.

And I want it to those particles have effect on my player like a collision with some detection but it doesn't Works.

I've configured the "void OnParticleCollision(GameObject other)" by tag, but in practice it doesn't collide with player.

I've set the colision on true, on inspector. And it do nothing at all.

I've tried to add a box collider or something else but it says is to small to detect it.

I'm using 2D settings for colliders.

Any tips? Thanks for the help.

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

22 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

Related Questions

Adding movement speed of Player to 1 Answer

Particle Collision / Trigger not being reported to On_xx Event 1 Answer

Check if player is colliding with top face of box collider? 1 Answer

Collision detection problem 1 Answer

how to move the player away when it's hit 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges