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 T27M · Feb 08, 2013 at 01:46 AM · c#particle collision

How reliable is particle collision?

Hello

I'm using the legacy particles with a world particle collider and I'm wondering if A)The collision is accurate or B) I'm doing it wrong.

I have a sphere object which is a placeholder for my enemy; on the sphere I have attached a rigidbody,sphere collider and the enemy script. When the enemy is enabled it simply moves towards the player using this line of code in the Update() method :

         Vector3 pos = (transform.position - player.transform.position).normalized;            // Get the direction to move
         
         transform.Translate(-pos * speed * Time.deltaTime);    

I tried using doing it with AddForce in FixedUpdate() and got some very strange results with seemingly random moving objects.

The particle emitter is instantiated (That's the only way I could get it to work, can I not use the Emit() method?) in when the player clicks to shoot and spawns only 1 particle. The size of the particle is 3, it just wouldn't collide with the sphere gameobject at smaller sizes. If a particle hits the enemy it calls the OnParticleCollision() method which calls another method within the enemy script and destroys the enemy. As the game progresses the speed of the enemies increase and eventually it gets to a point where the particle simply goes straight through the sphere.

I set the enemy rigidbody to interpolate and collision detection to continuous dynamic and noticed no change really.

I know this covers a few questions, but they are all related for my project and I've spent quite a bit time searching with no solid answers.

What I would like to know

  • Is there a better way to move my enemies?

  • Should I use the old particle system or can this be done with the shuriken system?

  • Am I using the correct methods to detect the collision or what is the best way for fast moving objects?

  • Can this be done with AddForce()? I thought this gave a smoother looking movement.

  • I tried using raycast to detect the collision, but found it very difficult to make it look like the bullet effect hit the enemy before it was destroyed.

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 Owen-Reynolds · Feb 08, 2013 at 03:12 AM

Moving with transform.Translate messes up physics. It's like dragging it yourself in Scene mode while the game plays. It sort of works if you move less than the collision error -- the physics step will notice and will push them apart.

The particle colliders are mostly just for special effects. It's, as best I know, not full-blown collision, with all the time that would take. Best way to fire a "particle" at something is to fire a regular rigidbody + collider, then attach (child?) a particleSystem to that. Then you can adjust the invisible collider to be as big as you need.

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 T27M · Feb 08, 2013 at 03:20 AM 0
Share

The first time I made this game I used a collider that was enabled when the player shoots and got fired towards the enemy, looks like that is the best way to go.

Thanks!

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

10 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Extinguish fire with water particle system 0 Answers

Initialising List array for use in a custom Editor 1 Answer

Illuminating a 3D object's edges OnMouseOver (script in c#)? 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