Home > other >  Unity particle effects
Unity particle effects

Time:09-22

Excuse me, create a cube, a sphere, two objects can be moved, in the event of collision, will generate particle effects, could you tell me how to write code (see a lot don't), it is better for comments, thank you!

CodePudding user response:

Starts the enter incident particles generated code inside the

GameOject go=GameObject. Initiate ()
Go. Transfer. The parent=XXX. Transfer

CodePudding user response:

Need two scripts, a script on the cube, a script on the sphere, can choose a script in the script, for example object is particalsystem note, then in oncollider monobehaviour script the life cycle of a function or any oncollision, see which one do you choose to trigger the particles, part code is very simple, don't think it's too difficult
  • Related