I've done some research and it seems the consensus is that two particle systems can't collide in unity.
Is there a creative work around or solution to have the effect of having two particle systems collide? I want it to behave like two "streams of water" colliding where each stream is a particle emitter. I can't think of a great solution besides making my own particle emitter, but even then it would be hard to mimic Unity's particle system behavior. I feel like there has to be a way to make that effect though.
Any ideas appreciated, thanks
Create a GameObject--the emitter--that spawns other GameObjects--the water particles--that have Rigidbody/Rigidbody2D and appropriate Collider components. The exact components you will need will depend on the shape of the spawned object.
To avoid performance loss related to instantiating and destroying many objects, you may want to use object pooling for the water particle GameObjects.
In these water particle GameObjects you'll want to implement OnCollisionEnter or OnCollisionEnter2D to handle the interaction between them. You can check for whether the collision is with another water particle inside of OnCollisionEnter*, and interact appropriately.
Related
I am working on a 2D game that involves many blocks that stack and collide on eachother and the player. I am currently using Rigidbody2D on the blocks for dynamic collisions but I am not a fan of how the dynamic physics include the "bounciness" in the elastic collisions. Also, there is an inherent push-force as well as other unfavorable push physics that are too "realistic".
I am wondering what is the best way to handle my predicament to remove the bounciness and push elements of the rigid bodies. I've tried adjusting the block's masses and bounciness physics but no luck. Is there a way to set them all as kinematic or disable these realistic effects somehow and still have them collide via rigidbodies? (Kinematic would be great if they were able to collide with each other) Or will I have to create some sort of raycast based block physics handling script? Or is there an even better solution to creating this very primitive physics structure that I am not seeing?
Thanks for any and all help!
The only way I could think of solving your problem, such that you have complete intuitive accuracy, is to write your own Rigidbody controller. Of course you can still reuse the Box colliders.
Once you've decided on a collision detection method and manifold generation working (raycasting maybe), this link details the impulse resolution you need.
I want to create an explosion particle system, but I'm not sure how can I do it. I was thinking create a fire particle system with emitter shape being an Sphere and after that just increasing sphere radius, but I don't know how can I animate it's size. Does anyone tell me how can I do that? Or does anyone have a better idea?
Emitter systems for particles are setting initial particle directions, and the rate they'll move at. That's generally how a visual representation of an explosion is created.
So rather than increasing the size of the emitter source to present an explosion, the dissemination of the particles in an outward direction creates the appearance of an explosion.
You're not limited to one batch of particles, nor one type of particles, nor just one emitter. The best explosions are a highly complex layering of different particle types with different textures, coming from different emitters at differing rates, with differing rates of decay, spin rates, colour changes and falloff in both transparency and movement speed.
Making a truly great looking explosion is a real art form and will often take a good designer days to do with a GUI and constant real time playback, especially when trying to minimise the use of textures, quads, blends, fillrate and physics.
Here's a video from Unreal Engine, wherein similar concepts and qualities as what's available in Scene Kit are used to teach the terminology. It's not a 1:1 parallel with the Scene Kit particle engine, but it's probably the best combination of visuals and simplistic explanations to help you rapidly understand what is possible and how to do it with particles.
//caveat: Unreal Engine probably has the best real time particle engine in the world at the moment, so it's a little more advanced than what's in Scene Kit.
But...the principles are essentially the same:
https://www.youtube.com/watch?v=OXK2Xbd7D9w
I have a particle emitter and I would like to detect it when the particles collide some physics bodies.
Is there a native way to do that in the SpriteKit API or do I need "to cheat" ?
Individual particles can not collide. Not with physics, not any other way. You do not even get any information about an individual particle - you can't access it's position, rotation, velocity .. nothing.
If you wanted to "cheat" you'd have to emulate the particle emitter using sprites, and animate the sprites with actions or manually. However keep in mind that this is much less efficient than a particle emitter.
In addition, if we're talking "particles" which often means dozens or even hundreds of them on screen, the amount of physics processing and collision detection quickly becomes prohibitively expensive if you were to model them using sprites with physics bodies attached. Do a performance test before you go down this path.
Particles do not have physics bodies, so they don't collide with Sprite Kit's physics engine
You can set the physics body of the particle emitter the same way you set it for any sprite node. Then you can set the category bit mask property and the contact test bit mask. The method didBeganContact can detect the collision afterwards.
didBegan contact is called whenever two bodies contact each other . Here is the apple reference link for how this method works:
Click [here](https://developer.apple.com/library/ios/documentation/SpriteKit/Reference/SKPhysicsContactDelegate_Ref/Reference/Reference.html#//apple_ref/occ/intfm/SKPhysicsContactDelegate/didBeginContact:"Apple iOS developer library")!
Does anyone know how I can detect when an SKEmitterNode particle makes contact with a SKNode in the SKScene?
I want to apply a little force to the SKNode when a particle makes contact with it for a 2D game I'm creating.
You can't. You can't get the location, size and other properties of individual particles.
The essence of a particle system is that its particles are minimalistic and under full control of the particle system. Hence you don't normally get any access to individual particles in a game engine, mainly because it wouldn't make sense to do so.
There can be specialized particle emitters built on regular sprites where you have access to particles and where particles can have physics bodies. Solutions exist for other engines but I'm not aware of one that works with Sprite Kit. These are always slower than regular particle emitters, especially with physics enabled, forcing you to use a lot less particles to begin with.
Chillingo launch a new game name "collision effect" attach is the image of the game any one know how to create this effect. i think it's collision by particles how to create this using cocos2D?
By programming it yourself.
This isn't supported by the particle system in cocos2d. You need a particle system where particles can attract or deflect each other, or even a particle system where you can apply physics or other movement logic to individual particles. Cocos2d doesn't give you control over individual particles.
You could create this with sprite-batched sprites but this won't be efficient or fast. Usually such systems are implemented at the lowest level, meaning custom OpenGL drawing, perhaps optimized with shaders.