How can I increase the number of particle sprites? - unity3d

I am making a defense game. Since the concept of the game is Christmas, we are using Christmas-specific particles, but since the number of sprites used for particles is so small, we need a way to increase the number of sprites. Is there a way to increase it in a particle system?
I've tried many things in the 'particle system' in the particle inspector to increase the number of particles, but I can only adjust the size.

Double-check that your Max Particles count is set to the desired number (default: 1000). If it is, then the settings you're looking for are located in the Emission and Shape modules of the Particle System:
By default, the Rate over Time is 10 particles per second; you could increase this value to have more particles. Alternatively, you could create Bursts of particles instead.
The default Shape is a 25-degree-angle Cone which faces the Z-axis. Feel free to change the Shape and/or the properties like position and scale to get your desired result.
I would also suggest looking at Unity Learn: Introduction To Particle Systems if you're new to this system.

Related

How to reduce Unity water particles splash effect?

I am trying to extinguish the fire particle using Unity water particle. Which is working. But the water particles Splash effect is overflowing. I tried to scale it but it"s not working. So how can I reduce the splash effect?
To stop the water particles from overflowing you can do a combination of two things:
decrease emission rate of particles or the velocity of particles. You find these things under certain modules. Here is the list of modules:
To change the emmission rate, find the particle system in the inspector and go to the emmission module. If not already opened - open it. Adjust the Rate over Time variable to a lower value, you should notice a lot less particles being formed.
Then to change the velocity of the particle system, this one can be change a few ways. And, it depends on how you change it for your water to go upwards. A good place to check is in the Velocity over Lifetime module and you want to decrease the speed modifier or the linear velocity values.
You may also want to check if lowering any velocity values from Limit Velocity over Lifetime, Inherit Velocity, Force over Lifetime solves your issue.
EDIT
To stop emitting particles just set the prediscussed particle emission Rate over Time back to 0. To do this inscript:
GetComponent<ParticleSystem>().emission.rate = 0.0f; // Or a higher number if you want to restart it
Also, when I notice your particle system, you don't have to add burst like I have done so in the examples. Just change the specific variables mentioned.

Does changing Physics.defaultContactOffset have an important impact on performance?

As usual, the documentation lacking some information we have to gather somewhere else: Physics.defaultContactOffset.
Physics.defaultContactOffset is used by the collision detection system to predictively enforce the contact constraint.
Unity explains you should use 1 unit = 1 meter for physic simulation.
I needed a lot of small spheres and cubes: 10cm width. Thus 0,1 "unit".
What they dont say is that when you're working on a small scale (I'm using objects of 0,1m width = 10cm) you have to change Physics.defaultContactOffset to a smaller value than the default one.
Hence my question: is Physics.defaultContactOffset important for calculations, i.e. if I change this to a very small value, does it have a negative impact on performance?
I have to change it from 0.001 to 0.00001 to get an acceptable collision detection system and I'm worried about a negative impact on performance.
From Unity3D documentation on Default Contact Offset:
Use this to set the distance the collision detection system uses to
generate collision contacts. The value must be positive, and if set
too close to zero, it can cause jitter. This is set to 0.01 by
default. Colliders only generate collision contacts if their distance
is less than the sum of their contact offset values.
So we can assume the physics engine is calculating distances between colliders and checking if the distance counts as a collision or not. I don't think it matters so much for performance as the calculation is done anyway.
With all this being said, Unity3d physics engine doesn't really do well with tiny objects, so it's better if you scale the spheres up to 1 unit, and scale everything else to compensate. You will most likely run into issues with these tiny colliders.

Swift: How to set size of particle effects with SCNParticleSystem?

I have simple ARKit app (using SceneKit) with cubes floating in space that I am shooting with other objects. I created .scnp file with Fire as a template and customized it to sort of look like explosion.
Everything looks good and works on collision, but my whole particle effect takes whole screen. I tried every property available on the .scnp file but the size is still enormous.
How can I set the effect area size? For example to be slighty bigger than my cubes (with width 0.1 meters).
This is how run the explosion:
let fire = SCNParticleSystem(named: "explosion.scnp", inDirectory: nil)
contactNode.addParticleSystem(fire!)
contactNode is my target cube.
The particle system property you’re looking for is particleSize. (There’s a control for setting that property in the Xcode particle system GUI editor, but I forget what it’s labeled...)
The docs for that property say:
The rendered size, in units of the scene’s world coordinate space, of the particle image.
In ARKit, scene units are the same as real-world meters. So while a particle size of, say, 10x10 might make sense in some arbitrary scene, in AR that makes each particle the size of a house. You probably want values somewhere in the scale of millimeters to centimeters (0.001 - 0.01).

New to unity and particles & gravity

I am fairly new to Unity3D and thought I'd give it a go to make physics models.
Here is what I would like to do:
Particles, white small ones, that "stream" outwards from a point, 360 degrees(4/3*πr3) in a shape of a sphere, a growing sphere. The paritcle system should release new bursts of "expanding spheres" quite rapidly and sometimes not as rapid. If I add another primitive to the scene, the particles should bounce in the opposite direction when they hit the surface of that primitive and when they bounce the particle "loses energy" and starts to fade away eventually.
I found the "Particle System" but it does not seem to spawn a ready flow of particles to generate a "exploding effect" that I am after. I hope someone with more experience could help me out :)
You could use the options under the particle system called bounce. and set it from 0 to 1 depending on how much you wanted it to bounce off. everything inside of the collisions tab is what you want, and adding a set amount of burst, would give the impression of a wave, bursts are under emission they need an amount and delay from start of the system.
For the sphere shape you go under the shape category and change shape from cone to sphere.
hope this helps.

How to make Hinge Joint more rigid

I'm trying to create a chain in unity3d. A player should be capable of grabing one side of it and pull it to different location. So i created some grids and connect them together. It all works fine, the problem is only when user pulls a bit faster, then I got some spaces bettwen seperate grids. Is there anyway to set max distance on that?
Btw. I'm doing these in 2d so i have 2d Rigidbody and 2d Hinge joint.
Thanks!
The solverIterationCount of rigidbodies affects the smoothness of physics when they are moving fast. You should try increasing it or dynamically adjusting it according to the speed of the rigidbodies to increase stabilty
http://docs.unity3d.com/Documentation/ScriptReference/Physics-solverIterationCount.html
There a number of ways to tackle this issue, all with the up sides and down sides:
increasing accuracy:: this is usually the first place new game designers go, and crank up accuracy to the max. But then end up playing the price later when performance plummets. So be gentle, try to find a good balance, and if it does not cut it make up the rest with other tricks.
The main ways to increase accuracy are, increasing fixed times interval, and increasing ridged body Iteration count
.
Increasing restrictions::This often requires the most time, but cutting corners allows for smoother more predictable physics and can increase performance
small example:: the top link of the chain only needs to simulate rotation on the ridged body
.
Cheating:: find any way to make things easier, fake it
for example:: does the image really need to match the physics? Why not make sure the sprites stick together, but alow the physics to have small gaps
playing with the same concept more or less this week, experimented some with 2D Unity joints, I think the issue you are having is identical to one I had yesterday, the force you are applying 'breaks' joints for some frames, hence that almost 'spring' joint effect, make sure the mass and/or force applied are not too heavy, also maybe increase the chain parts mass, makes the joints more solid too.
In Editor, Hinge Joint -> Use Spring = true; Spring/Damper/Target Position = 0.