• 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 /
  • Help Room /
avatar image
0
Question by Jojoba007 · Feb 13, 2017 at 08:11 AM · particlesparticlesystemparticle systemparticleemitterparticle collision

Little dust particles after player jump hitting ground

I'm searching for info that does the following:

After the player character hits the ground some little dust particles will be instantiated, but these particles must stay on the spot he justed landed so they wont follow the player when he walks on.

I found some older solutions but they don't seem to work anymore. Can anyone help me in the right direction?

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
0

Answer by ASPePeX · Feb 13, 2017 at 08:46 AM

Instantiate() a ParticleSystem at the position he jumps off/lands and don't make the player its parent. Good practice is to Destroy() it after it has done its job.

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 Jojoba007 · Feb 13, 2017 at 08:53 AM

@ASPePeX Thanks for your reply, I got the instantiate working, now I still need to spawn it at the location where he lands? There is a OnTriggerEnter on the location where he lands, but how do I get the location of his feet hitting the ground?

Something like this?

 GameObject dustObject = Instantiate(dustPuff, this.transform.position, this.transform.rotation) as GameObject;
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 ASPePeX · Feb 13, 2017 at 08:59 AM 0
Share

The easiest way to do this is to just take a fixed offset of the position of your player character. There are other possibilities like using Collision.contacts but that comes with its own set of problems.

avatar image Jojoba007 · Feb 13, 2017 at 09:24 AM 0
Share

I got it working, thanks for sending me in the right direction:

This is the code, as simple as it can be ;-)

At the top a variable for the ParticleSystem and the GameObject followed by the code wherever in which function you want to call it:

     public GameObject dustPuff;
     private ParticleSystem dustParticle;
 
 
 //Instantiate the dust particles when landing after a jump
 
                 GameObject dustObject = Instantiate(dustPuff, this.transform.position, this.transform.rotation) as GameObject;
                 dustParticle = dustObject.GetComponent<ParticleSystem>();

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

97 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

Related Questions

Particle collision Lifetime "Gain"? 1 Answer

Particles Colliding Inside Cube 0 Answers

Some question about ParticleSystem.emit() rendering 0 Answers

ParticleSystem.Bake() not working with specific particle 0 Answers

Are there any disadvantages to using the legacy Ellipsoid Particle System in Unity 5 over Shuriken. 0 Answers

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