Rate Over Distance Particle System Not Showing - 2D Gameplay - unity3d

I have bought a particle system pack from the Asset Store of Unity:
Epic Toon FX
Now within my project, I want to use object trail effects for my player spaceship.
So I have added my selected particle system object within the child of player spaceship object.
But I can't able to see any trail when I run my project within Unity editor.
Within the particle system, I have noticed that the emission rate is based on distance.
How to emission this particle system?
That is big question in the mind.
At present, its parent spaceship object is moving.

Your space ship game object must be having a kinematic rigidbody. The problem with rate over distance is that they are not good to go with kinamatic rigidbody. Try setting the type of rigidbody to dynamic with gravity scale to 0. This should help .
Moreover, remember to move the rigidbody by changing its velocity and not the transform. Also set the simulation space to world.
https://answers.unity.com/questions/1291623/particles-rate-over-distance-emission-not-working.html
#Siddharth

Related

How to prevent sliding with rigid bodies in Unity?

So, I am using Unity's Rigid body physics engine. And I made the player using a capsule collider. And after creating another rigid body with a Box collider I tried to jump onto it, only, the player starts to ever so slightly slide on top of it until eventually sliding off.
I want to be able to make the player jump onto movable objects without sliding on top unless there is enough of a slope to make sense for the player to slide off of. Is this possible, or does Unity's physics engine prevent this?
This can be achieved by applying a Physic Material to the player's capsule collider. Specifically, take a look at the Dynamic Friction and the Static Friction of the Physic Material. You may also want to set the Friction Combine to Maximum, if you want to ensure your player has a good grip on the platform regardless of what kind they land on.
A higher Dynamic Friction will quickly stop your player object if it starts sliding, while a higher Static Friction will make it harder for the player object to start sliding if it is otherwise stationary.
There isn't an exact science behind choosing these values; you'll really have to play around with it to see what feels right for your game.

It is impossible to implement accurate collisions in 3D SpriteRenderers? Is Billboard incompatible with rigidbodies?

I've been having difficulty implementing enemies with a billboarding system for a while:
For a new project I'm reusing some animated sprites from an old static camera shooter game I made. It consisted of shooting projectiles and hitting enemies advancing towards your position. The enemies were capsules which had an animated plane in front of them.
I wanted to go a step further and make a raycast system that would detect if the impact on a plane is on the alpha part of its texture. I achieved it using a SpriteRenderer and a plane that matched the size of the sprite which receives the impact of the Raycast.
The problem comes with the movement of the enemies. If I use Rigidbodies this conflicts with the plane which detects the impact, since I have to use a non-convex Mesh Collider for RaycastHit.textureCoord (With Convex colliders it doesn't return the correct position). I need Rigidbody based movement for the enemies to push each other when colliding.
I tried using Transform Movement, since the error does not occur, but this allows enemies to pass through each other and occupy the same space.
I started investigating navMesh but I'm not sure if it is possible to avoid collisions.
I started to place a group of trigger colliders on the enemy mimicking the shape of the sprite. But this makes it difficult for me to detect collisions when enemies do certain animations (Some enemies jump diagonally or their animations are a bit jittery).
I would like to keep the impact detection system for the sprite, but maybe there is another way to check the texture at the impact location.
I think my options are:
With rigidbody based movement: separate the animation and hit detection system from the enemy movement. And make the billboarding effect teleport to the object constantly.
With Transform movement: Detect if they are overlapping and move them in opposite direction to the overlapping to simulate the collision.
With motion based navMesh: I'm not sure if it will be useful to me, since the characters jump and I also believe that a Mesh Agent ship cannot simultaneously be an obstacle. I understand that the navMesh cannot be generated in runtime.
Leaving texture based detection and using the trigger colliders group: Animate the colliders to also follow the animations. Or simplify everything to a large collider, losing precision on impact.
-Find an alternative method to detect the impact coordinates in the texture, avoiding using RaycastHit.textureCoord and therefore Mesh Collider. (Although I would like to keep the impact detection system as it is, maybe there is a similar approach for the same result).
The reason I have not yet delved into these solutions is because I would like to keep the system simple. I'm trying to avoid separating the enemy into 2 gameobjects, simulating collisions or animating collider positions. I honestly don't know which way to go in order to move forward with the project.

How to have Unity Particle System render behind other GameObjects

I am using Unity Particle System to generate confetti when a user has finished a level. However, I am not able to have the particles appear behind the gameobjects. Any help would be appreciated.
I added the particle system to a gameobject, created a camera for it and have the camera for the particle gameobject. From there, I set the depth of the gameobject to 0 so that it renders behind the other gameobjects. Did not work.
UPDATE**
I have tried the following solution. However, I am unable to set the camera alpha to 0. I am able to put the particle system to an object but not able to set the camera alpha to 0. How can I do that?
This is what I am seeing.
Particle Camera
You can set the layer of particle system "Particle" and make two cameras, 1 for particle and set occlusion layer to "Particle" and other camera to have all layers except the "Particle" and set its priority higher than the previous camera.

Creating a primitive ramp in Unity - Not working as expected

Using cubes as my primitive game objects, I've created a runway, ramp and player. I expect my player to be flung into the sky on hitting the ramp at velocity, however the ramp stops my player cold in its tracks. I have friction and drag set low. Do I need to adjust mass? Should I use a rounded player?
Here are my object settings:
Ground
Ramp
Player
Ramp 3D
In the Collider component, you need to use Physical Material. In the Physical material, enter Bounciness "1"

Detecting when SKEmitterNode particle makes contact with another SKNode

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.