Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[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:
    860
    @BlockFade Just tried it and it's working as expected. What issue are you getting?
     
  2. BlockFade

    BlockFade

    Joined:
    Jan 28, 2017
    Posts:
    25
    @luispedrofonseca Actually, is the Zoom Amount in the Zoom function inverted? (Positive number to zoom out, negative for zoom in)
     
  3. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @BlockFade Yes, that's how it works which might be a bit unintuitive.
     
  4. Skyboard_Studios

    Skyboard_Studios

    Joined:
    Jul 20, 2013
    Posts:
    51
    @luispedrofonseca

    I have figured out the issue with the pan/zoom in the fact that I was manipulating the influence at startup on the pan object that is injected into the scene with the extension. but now I am facing another issue... I have created a second procamera2d camera for a minimap system that I have setup and it works... just now when I enable the zoom/pan feature on the minimap camera, it seems to affect the first camera... which I think is because of the the static .Instance. that is in play.... Can you confirm this that a second procamera instance can have it's own pan/zoom functionality.

    Although I did manage to add a Action event into the Zoom extension for detecting any zoom changes... so I could properly enable my minimap.
     
    Last edited: Dec 7, 2018
  5. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @Skyboard_Studio I'm a bit confused with you said. Do you need help listening to the Zoom event?
     
  6. Skyboard_Studios

    Skyboard_Studios

    Joined:
    Jul 20, 2013
    Posts:
    51
    Ohh just working out the kinks in everything that I have weaved together. Just issues with the zoom/pan system with a second camera that is in the scene.. I will keep testing...
     
    luispedrofonseca likes this.
  7. carolinemariast77

    carolinemariast77

    Joined:
    Nov 24, 2018
    Posts:
    5
    Hello, sorry about my english. I am beginer.
    I have not any character in scene Hyeracly. My Characrer spawn on check point. How can drop it in camera target?
     
  8. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @carolinemariast77 You have to use the ProCamera2D API to add your player at runtime. To do that you need to do something like:

    Code (csharp):
    1. ProCamera2D.Instance.AddCameraTarget( yourPlayer );
    You should call this method, for example, on the Start method of your player script.
     
  9. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    280
    Hi @luispedrofonseca

    On Unity 2018.3 with ProCamera 2.6.7 I get the error:

    Assets/ProCamera2D/ProCamera2D.cs(988,30): error CS0103: The name `_startScreenSizeInWorldCoordinates' does not exist in the current context

    Thanks
     
  10. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @coshea Yeah, that issue (that only occurs if using the TK2D preprocessor) is fixed on the next release which I'm uploading today. I'll send you the package in a PM so you don't have to wait.
     
  11. lonehamster

    lonehamster

    Joined:
    Aug 14, 2018
    Posts:
    37
    Hello. I'm new to game development. What's the best way to get the camera to follow mouse? Just purchases this asset today.
     
  12. Burst_FPS

    Burst_FPS

    Joined:
    Oct 9, 2018
    Posts:
    2
    - Hi I found these errors when Imported plugin to project
    Can you help me looking for the cause of the issue
    Unity 20188.2.20f1 OSX
    Blank Project work fine.
     

    Attached Files:

  13. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
  14. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @Burst_FPS I just tried to import ProCamera2D and Unity Standard Assets to a new project and I get no errors.
    What assets are you using and how are you importing them?
     
  15. lonehamster

    lonehamster

    Joined:
    Aug 14, 2018
    Posts:
    37
    luispedrofonseca likes this.
  16. Burst_FPS

    Burst_FPS

    Joined:
    Oct 9, 2018
    Posts:
    2
    Sorry my bad juse have to Type System.Action instead of Action in every script
     
  17. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @Burst_FPS To avoid that you just need to add the following to the top of your scripts. You don't need to edit ANY ProCamera2D file to make it work.
    Code (CSharp):
    1. using System;
     
  18. Pixelkeyblade18

    Pixelkeyblade18

    Joined:
    Jan 18, 2019
    Posts:
    3
    Hi, loving pro camera 2D. Is there a way to combine the parallax camera in orthographic with a perspective camera so I can rotate some elements of the background? Thanks
     
  19. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @Pixelkeyblade18 Not sure I understand what you're trying to do. Can you please explain further?
     
  20. Adoll

    Adoll

    Joined:
    Apr 16, 2016
    Posts:
    20
    Hi. This asset is gold, but I currently have a strange problem that is specific to me to solve:

    What I want to achieve is to limit camera effect such as blur effect to exclusively the foreground camera layer without interfering with the player and platform layer. I know this is more about how Unity handles camera layering with image processing, but I still wonder if you have any solution.

    My current setup is to use a render texture in front of the platform layer and a camera with black color as Clear Flag(the color of my platforms), so everything in the foreground would be limited to this render texture. There are two problems with this setting, though. One is that no sprite in the foreground can be too tall, or it will look like being cut. The other is that it seems often pro 2d camera forcefully and automatically changes the value of Clear Flag of the foreground camera to "depth".
     
  21. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @Yinmo If I understood correctly you're trying to use the Parallax extension while blurring the foreground camera? If that's the case, my recommendation would be to do it some other way, because the approach you described is really "expensive" and will probably cause performance issues. Why not just manually blur the assets of the foreground?
     
  22. Adoll

    Adoll

    Joined:
    Apr 16, 2016
    Posts:
    20
    Yeah, you understood correctly. And blur effect is just an example, I might have to apply different effects. Thanks anyway for your suggestion.
    And the performance is fine since I will just need one render texture object syncing the x position of the main camera and keeps a static y position, which is more or less a "minimap".
     
    luispedrofonseca likes this.
  23. zapposh

    zapposh

    Joined:
    Nov 12, 2016
    Posts:
    111
    A have a pretty basic setup: 16:9 only in the player settings, 16:9 in the editor game window.
    On ProCamera2D I have a couple of rooms, parallax and pixel perfect, also in the 16:9 ratio.

    Initially the cam size is about 8.42 (see screenshot), but it changes size automatically even just when moving around or resizing Unity, without actually changing any settings! It is impossible to have any control over it.
    Which is what I did to grab this clip. So even though the camera does not fully take up the room height (which it is supposed to), it still looks halfway acceptable after changing room:


    But if I build the game (exactly the same scene as the previous clip), the camera size seems to totally change again, and does not represent what was seen in the editor. You can see this very clearly at the end of the clip, where the player is chopped off (so about 4 units missing compared to the room height).


    Going nuts here after going in circles for days.
    Ideas?

    [edit] PS: in the second clip you can also see the background break between the rooms, as the parallax is different in the build than in the editor game window.
     

    Attached Files:

  24. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @zapposh When testing in the editor you should set the Game view to a predefined size instead of aspect ratio.
     
  25. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    244
    Hi, this asset seems great.

    I am not sure I understand the 2.5D limit. I am mainly doing VR (360 videos) so I guess you can not use it for first person camera views and certainly not for 360 videos but can this camera asset be use in a pipeline do create normal Pseudo 3D like cinematic movies for television?

    Thanks!
     
  26. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    Thanks! Pro Camera 2D can basically work on any environment where it only needs to move in 2 directions.
    2.5D means that you can use it with perspective/3D environments and not only in orthographic mode.
     
  27. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    244
    Thank you for the quick reply. At the moment I am working with all axes (full 3D) but I will definitely keep on eye on this asset.
     
    luispedrofonseca likes this.
  28. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @netpost Thanks, but just to remind you that Pro Camera 2D works on any axis (i.e. XY, XZ and YZ). As long as the camera sticks to one of those planes, you can use it.
     
  29. netpost

    netpost

    Joined:
    May 6, 2018
    Posts:
    244
    That's great! Can it be use in with a multi virtual camera setup and the unity timeline? I am just asking because I am not developing any game for now.

    Thanks.
     
  30. Testeria

    Testeria

    Joined:
    Aug 15, 2013
    Posts:
    18
    First I want to thank You for this great asset, one of my favorites from asset store.

    But I have a question:

    I just started simple shooter game. I need a camera, that would scroll background image (looped or with generated parts on demand). For now it is just one direction, but with speed dependent on player speed.
    Can I use Camera2d for this task or do I have to write my own?

    Thanks!
     
  31. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    48
    Hi,

    I'm just started using the pro camera and I have to say I'm impressed!!
    I do have one question though. Before this I was using the pixel perfect package from Unity. The pixel perfect
    camera from Unity also renders my sprites the way I want them when they are rotated :

    upload_2019-5-5_20-16-38.png

    But when I add the pro camera and disable the unity pixel perfect camera it looks like this :

    upload_2019-5-5_20-17-50.png

    When I also enable the Unity pixel perfect camera it still looks like the second image.
    I also tried to enable the pixel perfect extention from the pro camera but then it's also still like the in the second image.

    Do you know if there's a way to get it rendered like in the first image?
     
  32. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @Testeria Not sure I fully understand what you need, but have a look at the Repeater extension. It might be what you need: http://www.procamera2d.com/user-guide/extension-repeater/

    @vambier Yes, that's correct. ProCamera2D's pixel perfect extension does not pixelate the sprites, like other solutions do. If that's the effect you're looking for you'll need to use something else for the time being. I'm planning to introduce a couple other pixel perfect methods in an upcoming release, but no timeframe yet.
     
    tosiabunio and Testeria like this.
  33. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    48
    Is it not possible to use the pixel perfect package from Unity next to the pro camera 2d?
     
  34. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    Yes, although I haven't tested it extensively, you can use it with the ProCamera2D core and the other extensions. Although the extensions that alter the screen size (like zoom to fit, etc) will probably mess up the "pixel perfectness".
     
  35. vambier

    vambier

    Joined:
    Oct 1, 2012
    Posts:
    48
    Thanks for the answer, I found out what was causing my problem. I have enabled the paralax extention and if I disable that one it works fine. See if I can work around that issue.
     
    luispedrofonseca likes this.
  36. DavidMBradbury

    DavidMBradbury

    Joined:
    Nov 18, 2012
    Posts:
    9
    Searched and couldn't find anything, but in case anyone else runs into an issue - If you're using the Post Processing Stack, make sure to uncheck 'Directly to Camera Target' if you're using TransitionsFX! Thanks for the great asset.
     
    luispedrofonseca likes this.
  37. SwingWren

    SwingWren

    Joined:
    Mar 1, 2014
    Posts:
    11
    Hello, I get this error:

    Instance of ProCamera2DEditor couldn't be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.

    I'm missing some setup to make this plugin work?

    I'm using unity 2019.1.3f
     
  38. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    Hi @Marchy,

    That's weird and you definitely shouldn't be seeing that.

    What Unity and ProCamera2D versions are you using?
     
  39. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,715
    Hey,

    Noticed this interesting asset while trying to figure out some camera tasks I am tackling. I have a question; I want to be able to zoom/pan with boundaries that the Camera cannot go past no matter what, does the asset handle this well?

    Thanks,
    jrDev
     
  40. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
  41. imtomgamedev

    imtomgamedev

    Joined:
    Jan 11, 2019
    Posts:
    1
    Hi Luis, I’m looking into the pro cam 2d asset and specifically am interested in utilizing a camera dollying in scenes. Is dolly functionality something that the asset offers? I am fairly new to unity and am unfamiliar if this can easily be accomplished without the benefit of an asset. But your pro camera asset has other features that interest me as well. Any guidance you can offer is appreciated! Tom
     
  42. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
  43. Luchianno

    Luchianno

    Joined:
    Nov 22, 2013
    Posts:
    2
    Hello!

    I've got "Instance of ProCamera2DEditor couldn't be createdInstance of ProCamera2DEditor couldn't be created" Problem as well.
    Though it happened after I added AssemblyDefinition files to the package. I added one file to the root of the ProCamera2D folder and one file for each Editor folder. Everything compiles fine, but when I select ProCamera2D script, two things happen: error and this (attached file):

    Quick Edit: Weirdly, turning Unity on and off helped :D.
     

    Attached Files:

    Last edited: Aug 2, 2019
    luispedrofonseca likes this.
  44. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    668
    So I have a few questions about the pan and zoom extension:

    1. Is there a way to flip the wheel direction for zoom in / out as it seems to be the exact opposite of what I would expect (it works the opposite of how wheel zooming works in unity's own scene view)?

    2. While the drag pan works, it there a built-in solution for panning with the keyboard (like WASD and / or the arrow keys)? If not is there any example of reference for APIs that I could use to create a script to do that myself (what ProCamera2D apis would I need to use)?
     
  45. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @ryanzec

    1. Set the zoom speed to a negative value.

    2. Create an empty GameObject, add it as the camera target, move it as you wish.
     
  46. ryanzec

    ryanzec

    Joined:
    Jun 10, 2008
    Posts:
    668
    @luispedrofonseca Cool, I think it might be helpful for #1 to either update the tooltip to mention this or add a bool option that makes it negative automatically. For #2, that it just my own stupidity.

    Thanks again.
     
    luispedrofonseca likes this.
  47. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,715
    Hello,

    I appreciate the reply. I haven't started much camera work yet and decided to come back and asks some more questions. I noticed in the PanAndZoom section there was a Edge Pan mode but it only seems it will work on Desktop? I want this kind of use case but for touch since I want to be able to drag an item around screen so the camera needs to start moving to keep the object in the middle as best as it can (unless the Numberic Boundaries have been met). Is this possible?

    And talking about Numberic Boundaries, can this be adjusted runtime since my level board will change size, so I need to adjust boundary limits?

    Thanks,
    jrDev
     
  48. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    860
    @jrDev The EdgePan mode doesn't work on mobile because it wouldn't make sense for the user to touch/drag on the edges to move the camera.

    As for your use-case, the best approach is to add that object as a camera target while you drag it and the camera will follow it.

    Regarding the Numeric Boundaries, yes, you can change them however you like at runtime.
     
  49. jrDev

    jrDev

    Joined:
    Nov 5, 2008
    Posts:
    1,715
    Great!

    I know it doesn't make sense for Edge Pan because there is also no mouse and we can't be precise too.

    Another thing I wanted to know if it was possible was to set levels of camera zoom snapping so for eg. I have a grid 15x15 cells and I want the camera to always have edge to edge perfectly showing the full cell no matter what zoom level. It should be showing a full square (or multiples of the square cells without cutting them off). I don't know if I made that clear. Let me know if you understand.

    And thanks for the quick reply.

    EDIT: Are Numberic Boundaries accessible by Playmaker actions? Is all of Pro Camera accessible by playmaker?

    Thanks,
    jrDev
     
  50. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    164
    luispedrofonseca likes this.
unityunity