Search Unity

[RELEASED] Pro Camera 2D - The definitive 2D & 2.5D Unity camera plugin

Discussion in 'Assets and Asset Store' started by luispedrofonseca, Jul 29, 2015.

  1. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @JohnGate I'm sorry but animation is not something that fits into ProCamera2D. You can easily achieve that with a basic script and then combine with the Repeater extension for the results you pretend.

    If I start adding animation and other features it will make the plugin bloated and unfocused. Feel free to reach me through support if you need more help.
     
  2. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @ParityClaws That's very weird. It should work with Unity Cloud too. I'll see what's going on and get back to you ASAP.
     
  3. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @ParityClaws I just tested Unity Cloud Build and everything seems to be working. What ProCamera2D version are you using?
     
  4. ParityClaws

    ParityClaws

    Joined:
    Aug 1, 2015
    Posts:
    15
    Thanks for your quick reply, sorry for my delayed response :). I have version 2.0.1 and I am using Unity 5.3.4f1. If it's working for you, it's probably an issue with my Unity or something else with my project, I will keep digging.
     
  5. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @ParityClaws What platform are you trying to build for?
     
  6. ParityClaws

    ParityClaws

    Joined:
    Aug 1, 2015
    Posts:
    15
    Building for iOS, it builds fine in xcode and with using iOS Build Environment in Windows.
     
  7. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @ParityClaws Unfortunately I don't have access to an Apple Developer account at the moment. But if it's working on Xcode, I'm really not sure what could be happening. Can you maybe try with Unity 5.4 Beta?
     
  8. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    v2.0.2 was just released and contains the following updates:

    - Improved the LetterBox of the Cinematics extension so it doesn't render when it's set to 0
    - Improved TriggerInfluence algorithm to provide smoother results when using the ExclusivePercentage parameter
    - Improved LetterBox and TransitionsFX shaders
    - Fixed camera start position when parented
    - Fixed null reference bug on PixelPerfectSprite under certain circumstances
    - Fixed a bug where a PixelPerfectSprite could get misplaced on certain occasions
    - Added the action "OnShakeCompleted" to the Shake extension to know when a shake has completed
    - Reset Shake presets and Rails nodes from the editor after scene load


    After the huge refactor that v2.0.0 was, with the inevitable bugs, things are finally coming to a stable state again. If you haven't done so before please upgrade to this version and let me know how things are working for you!

    Thanks!
     
  9. ParityClaws

    ParityClaws

    Joined:
    Aug 1, 2015
    Posts:
    15
    Hi tried with 5.4 and had the same problem. Don't worry yourself with for now, it's probably something on my end. I have other ways to build so it's all good. Thanks for helping :)
     
    luispedrofonseca likes this.
  10. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @ParityClaws OK, but keep me posted if you find out something about it. I'll keep an eye open on this.
     
  11. ParityClaws

    ParityClaws

    Joined:
    Aug 1, 2015
    Posts:
    15
    Thanks for your help I will let you know.

    Another question, is there a way to detect when a cinematic has stopped, ie, I trigger a cinematic to play, and when it stops I want to trigger something else? I can check movement of the camera relative to the normal (non-cinematic) target, or I can put in a wait for x seconds in a coroutine but just wanted to check if there was another way which is built into the asset?


    Edit: Never mind I worked it out, I saw you have set an Action to CinematicEnded, I can use that, love your work :D
     
    Last edited: Apr 16, 2016
    luispedrofonseca likes this.
  12. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    I noticed that using a speed based zoom camera and zoom triggers are not very compatible.

    Once the target (in my case the player) hits the zoom trigger, the camera will try to zoom in, but doesn't really succeed.

    Any one else has this? Or knows a solution?
     
  13. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @zero_equals_zero That is correct. The thing is that having multiple extensions / triggers trying to change the zoom at the same time it will result in odd behaviours like the one you're reporting.

    This one seems to be a common combination that people usually have together. I'm thinking that I could implement an option to turn off the SpeedBasedZoom extension when inside a ZoomTrigger. Would that work for you?
     
  14. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    I guess that would work. I've written a custom script by now to switch between two pro2D cameras which amazingly work fine for now. All I did was copy the camera (removed the zoom trigger), parented it and catches the zoom trigger to switch back and forth so I don't have double renderings. In my tests I don't see any jumping or oddities, but its just a small testing scene. But for now it will work during prototyping. Still of course I consider it a hack :) but hacking is fun.

    Good luck!
     
    luispedrofonseca likes this.
  15. underoathgames

    underoathgames

    Joined:
    Sep 17, 2013
    Posts:
    15
    Hey Luis, super awesome tool. One of the best in the asset store IMHO. I do have a small issue when trying to set the orthographic camera size. I'm using a few extensions, the speed based zoom and the pan and zoom. I only use one of them at a time, pan and zoom during in game, runtime "editing" mode, and the speed zoom one while in game "Playing" mode. The edit and playing modes I'm referring to are my in game modes and not the unity editor.

    All works well until I return to my edit mode and I'm trying to reset the camera size back to the original size it started with. The screen flickers really fast like it's trying to reset the size but just returns to the size it left off with when the speed zoom extension was enabled.

    Do you have any suggestions on how to set the camera size when the pan zoom extension is enabled?
     
    luispedrofonseca likes this.
  16. underoathgames

    underoathgames

    Joined:
    Sep 17, 2013
    Posts:
    15
    Ok, I figured it out. I used ProCamera2D.Instance.UpdateScreenSize() method and is seems to be working fine :) Thanks.
    (hive five to self)
     
    luispedrofonseca likes this.
  17. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
  18. JanduSoft

    JanduSoft

    Joined:
    Mar 14, 2014
    Posts:
    8
    Hi @luispedrofonseca

    we are working on a multiplayer platformer and we need some help, maybe you can help us with your asset ProCamera.

    We are trying to make a rails camera that have a zoomin/zoomout to fit our players targets (with a windows), something similar to Rayman Origins (see the video below)



    Is there any possibility to make this with proCamera now? or we need to create a custom "extension".
    Can you help us to write this extension?

    We need an extesion "Zoom to Fit Targets with Rail"

    Thanks in advance
     
  19. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    Hi @JanduSoft,

    You should be able to achieve that without writing any custom extensions. You can combine the current extensions Zoom To Fit and Rails and it will work out-of-the-box.

    If you run into any trouble or are just looking for tips feel free to contact me through support.
     
  20. JanduSoft

    JanduSoft

    Joined:
    Mar 14, 2014
    Posts:
    8
    Unfortunately, Zoom To Fit and Rails does not work together.
     
  21. mamdooh

    mamdooh

    Joined:
    Jun 23, 2015
    Posts:
    2
    Hay ..

    I am very happy with Procamera2d because it save me a lot of time .. but I have small problem ..

    I used NGUI HUD text "GUI Element" .. and when I use your "pan and zoom" extension .. the text above my character has been move smoothly out of my character..

    I need that text to be fixed above my character ..

    Can you help me to solve this problem ..

    Animation4.gif
     
  22. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @mamdooh I don't see any reason why that would be happening. Does it still happen when using a normal camera?
    If not, can you please share a sample project (through support) that replicates the issue?
     
  23. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @JanduSoft Thanks for the email. The ZoomToFit and the Rails do work together. What you were trying to do is using ZoomToFit with a single target and that's why it wasn't working.
    Any how, I sent you an example file showing you how to go around that. ;)
     
    Last edited: Apr 28, 2016
  24. mamdooh

    mamdooh

    Joined:
    Jun 23, 2015
    Posts:
    2
    The problem has been solved ..

    It should change "Update Type" in Procenema2d to "Fixed Update" ..
     
    luispedrofonseca likes this.
  25. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    Hi, having trouble getting "Pan and Zoom" to work without stuttering
    Only have "Parallax" and "Pan and Zoom" extensions enabled, plus a Camera Target
    "Allow Pan" False
    I've tried all "Update Type:" settings (can't use FixedUpdate because i have physics "turned off" set to 10)
    as long as i continue inputting a zoom value it updates to the center like it should (but with stuttering)
    if i stop then the camera stops following the player

    i noticed that a pan target is added even tho allow pan is set to false,
    removing the target gets the camera to follow like normal
    but using zoom still stutters the camera when
    -trying to zoom out past max
    -trying to zoom in past min
     
    Last edited: May 4, 2016
  26. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight The "Pan And Zoom" extension works best when the camera has no other targets, as you've already noticed. This is because the camera with the PanAndZoom the camera needs to be manually controlled, whereas when having a target it's automatic.

    Regarding the stuttering you're getting, would it be possible for you to create a sample project that replicates the issue and send over to me? Please send me a PM or email through support.
     
  27. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    @luispedrofonseca hey :), Yea it only happens with a camera target

    it can be replicated by opening the PanAndZoom example scene you have included in your asset
    make the Player gameobject the target of the camera
    (optionally set Mouse Zoom Speed higher to speed up the test)
    hit play
    zoom in all the way
    now continue to zoom in while moving the player
     
  28. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight Thanks for the explanation. I'll see what I can do about it and get back to you.
     
    AVOlight and Too-Nerd-To-Die like this.
  29. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey Luis,

    how can I control my camera, which has the ProCamera2D-Component attached, independently of ProCamera2D :) ?

    I want to tween the Camera with DOTween, but in order to do so I couldn't find a handy method to stop control except disabling the ProCamera2D-Component when the tween starts and enabling when the tween is finished for something like this:

    - tweening the cam from Player to position A, disabling at first the ProCamera2D-component
    - camera-tween is completed
    - camera tweens back to Player, when reached player, enabling the ProCamera2D-component

    Now the last part gives me of course a weird result since enabling the Component again will cause the Camera to reposition to the correct manner which is of course correct but looks S***ty for a couple of frames.

    What can I do seize the control and make especially the last part as smooth as possible?
     
  30. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @BTStone That's an interesting question. You can do it exactly like you're doing it now, but before the last step just call the "Reset" method. I believe this should work, but let me know if it doesn't! Cheers
     
    BTStone likes this.
  31. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    @luispedrofonseca Mhm, doesn't seem to work :/

    Code (CSharp):
    1.   public override void StartCutsceneState()
    2.         {
    3.             m_proCamera.enabled = false;
    4.             m_holdTimer = holdTime;
    5.  
    6.             m_Tween.Restart();
    7.         }
    8.  
    9.         public override bool UpdateCutsceneState()
    10.         {
    11.             if (m_Tween.IsComplete())
    12.             {
    13.                 m_holdTimer -= Time.deltaTime;
    14.  
    15.                 if (m_holdTimer < 0f)
    16.                 {
    17.  
    18.                     m_proCamera.enabled = enableProCamera;
    19.  
    20.                     if (enableProCamera)
    21.                     {
    22.                         m_proCamera.Reset();
    23.                     }
    24.  
    25.                     return true;
    26.                 }
    27.             }
    28.  
    29.             return false;
    30.         }
    I have two of these scripts attached at my Cutscene-Object. The first one tweens to the targetposition and stays for a specific amount of time at this targetposition (m_holdTimer), if the timer is below the currenct CutsceneState is over and the next one is triggered, within I check if I should activate the ProCameraComponent (which is set in the Inspector),
    the next CutsceneState is the same script. Tweens from the camera from the initial targetPosition to the player and stays at the player-centre the m_holdTimer-amount, then, since "enbleProCamera" is set to true in the Inspector I'm calling .Reset().

    I tried to call .Reset before I set the camera to enabled, didn't work either. Still the same result.
     
  32. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    It's very hard to tell what's going on with your code @BTStone. One possibility is that you might be calling the Reset method multiple times?

    Can't you just listen to the Tween completion event and do the enabling and reset there?
     
  33. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Well, it's not really complicated, think of UpdateCutsceneState as the basic Update-Method (in fact it is called within an Update-Method), the moment it reaches return true the Updating is finished, so there's no way that the Reset-Method is called multiple times.

    That being said, I tried out what you suggested. Doesn't work either.

    I tried it the super basic way with DOTween and without our cutscene-system and attached only a DOTweenAnimation-Component to the camera and setup the OnStart and OnComplete-Events and it's the very same result:

    http://gph.is/1ZhkKzX
     
  34. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @BTStone I'll try to replicate that on my side and get back to you.

    [EDIT]
    Can you please try to call the "Reset" method with the false parameter? This way the camera won't go to the targets, so when you enable it again it should smoothly transition.
     
    Last edited: May 5, 2016
  35. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Using false as a parameter works standalone, but this way the Reset() controls the way how the camera moves back, and thing is that I want that control :D

    Doing that in the Cutscene-System works, too, but it gives still not the best result:

    http://gph.is/1Tp1wnr

    Reminder whats happening:

    - first tween: disables the ProCamera2D Component -> tweens the camera to Targetposition,when tween completed, timer counts down, if below zero, first Cutscene is completed, UpdateLoop closed.

    - second tween: (ProCamera2D Component is still disabled) -> tweens the camera to new TargetPosition (Player),when tween completed, timer counts down, if below zero, calling Reset() and enabling ProCamera2D and Cutscene is completed, UpdateLoop closed.


    I'm trying to get this work as a workaround, since I have issues with the ProCamera2D-Cinematic-Extension and our CutsceneSystem (I mailed you about this) but since this also doesn't seem to work as easy as I thought this is starting to give me some headaches since we have to get this to work as fast as possible, since we've got lots of camera-movements here and there.
     
  36. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @BTStone Like I told you on the email, I'm still not understanding the issue you're having.

    I just tried this one my side and it worked fine:

    1) Disable the camera and move it manually
    2) Call the Reset(false) method
    3) Re-enabled the camera
    4) The camera smoothly transitioned back to the current targets.

    This flow should allow you to build any kind of manual control or cinematics you wish. Am I missing something?
     
  37. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    @luispedrofonseca Please answer my last mail then :)

    1) Disable the camera and move it manually
    2) Call the Reset(false) method
    3) Re-enabled the camera
    4) The camera smoothly transitioned back to the current targets.

    And yes, you did miss something. Step 2) and 3) and 4) are controlled by the Reset-Method and how it works. I can't control the speed or the way it eases back to the current targets, but I want to control it and I can do that with DOTween but in order to get it to work I have to do this:

    1) Disable the ProCamera-Component, tween to the desired position with DOTween
    2) stay at the desired position
    3) tween back to the player with DOTween (camera is still disabled and Reset is not called)
    4) when the camera is tweened back to the Player in and the tween is officially completed I call Reset and enable the ProCamera-Component

    And I guess the issue is that the tween goes back to the absolute playerposition and then I call Reset and enable the cam and the cam has to recalculate it's setup (all those values in the ProCamera2D-Inspector) and reposition accordingly and this gives the subpar result.
     
  38. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    The reason you're seeing that bump at the end is because you're sending the camera back to the center of the player and that's not where ProCamera2D would be.

    An easier way to achieve this would be to add another camera target (and animate it with DoTween) and setting the influence on player to zero. Once the new target animation is done, remove the new target and set the player influence back to 1.
     
  39. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Just this moment I solved the other issue, mailed you already - but I'll try to get this done also with DOTween.
    I'll try what you suggested.
     
  40. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
  41. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
  42. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight Yes, it's on my to-do list. Should pick it up soon. Sorry about the delay!
     
    Too-Nerd-To-Die likes this.
  43. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
  44. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight This problem you're having is in what platform? Also, can you explain me a little better your use case?
     
  45. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    @luispedrofonseca On Windows in Unity Editor and Standalone builds,

    so your not getting the issue in the Unity Editor?
     
  46. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight I am. Just wanted to understand an use-case for zooming while also tracking a camera target.
     
  47. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    @luispedrofonseca with the 2d character in my game, i've set it up with the player as the target, i've found its much more user friendly when the player can control zooming in and out, and change it based on there device and personal preference
     
  48. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight Makes sense. This issue is a little trickier than I initially expected so I'll need a bit more time. I'll keep you posted.
     
  49. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
  50. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    943
    @AVOlight The issue you reported is fixed and will be part of the v2.0.4 release. If you'd like to get early access please contact me directly with your invoice number and I'll send you the new version.
     
    AVOlight likes this.