Search Unity

Particle Effects with Cinemachine

Discussion in 'Cinemachine' started by Kev00, Mar 22, 2018.

  1. Kev00

    Kev00

    Joined:
    Dec 6, 2016
    Posts:
    229
    This might seem like a noob question, but what is the best way to deal with particle effects instantiated off screen with Cinemachine?

    I've noticed that when a particle is instantiated off screen and a vcam is blending towards that location, the particle effect does not appear.

    Is there something special I need to do with Cinemachine and/or the particle system?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Cinemachine is just a fancy way to animate your camera transform. I don't see how using it can have any impact on the way the particle effects work.
     
    karl_jones likes this.
  3. cRUSh75

    cRUSh75

    Joined:
    Jun 8, 2017
    Posts:
    19
    The only thing I could imagine is, when you are blending the cam towards the particles, and the PS itself is not set to be rendered to camara facing, it might be that the particles are invisible in the the view during blendtime, and are finally only visible as soon as the camera reached it's destination.

    But if this is the case, you can adapt the rendersettings of the PS to align to the camara facing ... Just a guess.. :)
     
    karl_jones likes this.
  4. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    CM doesn't create any additional cameras. It uses virtual cameras which drive the actual MainCamera via the 'Brain' component. There's only one real camera in the scene, which is animated from all the virtual cameras.

    Think of CM as an animation system for the single MainCamera in your scene. So whatever your particles do with the main camera is what they'll do with CM.
     
  5. HooksForFeet

    HooksForFeet

    Joined:
    Jun 4, 2019
    Posts:
    1
    Late, but - this does not appear to be true. If I attach a particle system to a camera that is animated by a Cinemachine virtual camera, the particle system does not move with the camera. In fact, no child of the camera appears to move when the camera is moved by Cinemachine.
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    @HooksForFeet Child objects of the camera do indeed move with the camera when the camera is moved by Cinemachine. I just tried it now. Can you make a small repro project that shows the issue you are seeing?

    Edit: one potential problem that you might be having could be due to execution order. CinemachineBrain moves the camera in LateUpdate, and in addition it has a late execution order, to make sure that any targeted objects have been positioned first. If you have logic that takes camera position as input, you must make sure that it executes after CM has positioned the camera.