Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. MaddoScientisto

    MaddoScientisto

    Joined:
    Jan 30, 2015
    Posts:
    62
    Just implemented the camera in my project and the process was quick and painless!

    Now I wonder: I set my camera target from code when the scene loads but as soon as I do the camera transition towards it, is there a way to "jump" the camera to the object without transitioning before this happens? I'd want that to happen or not depending on the situation, for example when the scene first loads I'd like the camera to already be where the object is but if I set it in other moments the normal movement should apply.
     
  2. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Glad the setup was painless @MaddoScientisto! :)

    If you want to manually move the camera instantly to a given position you can use the method:
    Code (csharp):
    1. MoveCameraInstantlyToPosition(Vector3 newPos)
    This method is not yet added to the User Guide but I'll take care of that.

    If you add the targets on the editor, you can simply toggle the "Center Target on Start" checkbox to jump, or not, instantly to the targets position when the scene loads.
     
  3. Async0x42

    Async0x42

    Joined:
    Mar 3, 2015
    Posts:
    104

    Ah, the helpers I mentioned were for generating boundary triggers for tk2d tilemaps in the scene, for 'zelda-like' snes gameplay. I've been gradually working on it, but didn't post anything yet!

    Like this: http://imgur.com/j87qXWQ
     
    Last edited: Oct 2, 2015
    luispedrofonseca likes this.
  4. MaddoScientisto

    MaddoScientisto

    Joined:
    Jan 30, 2015
    Posts:
    62
    @luispedrofonseca haha such a literal function name. I add my targets only from code though but this function should take care of it
    @Async0x42 that's pretty cool, I'm not making that kind of game but I'm looking forward to seeing those helpers when you do release them
     
    luispedrofonseca likes this.
  5. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    I like to keep things clear! :p
     
  6. cparki3

    cparki3

    Joined:
    Jan 13, 2014
    Posts:
    41
    This looks fantastic! I only have one question. I'm working on a multiplayer platformer with split screen. Can I use an instance of ProCamera2D for each camera? Just want to be sure before I shoot some fundage your way ;)

    Thanks!
     
  7. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @cparki3 To be honest, having multiple instances of ProCamera2D is not something I tested thoroughly but I don't see a reason it wouldn't work. To confirm, I just did a quick test and everything appears to work normally. However, if you encounter any issues or you're simply not satisfied with the plugin, I'll gladly refund you.
     
  8. cparki3

    cparki3

    Joined:
    Jan 13, 2014
    Posts:
    41
    Awesome! Thanks for the quick follow up.
     
  9. LoDx

    LoDx

    Joined:
    Feb 13, 2013
    Posts:
    67
    luispedrofonseca likes this.
  10. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Thanks @LoDx! Although it's not mentioned on the User Guide, you do have access to pretty much every ProCamera2D property. You can access them with a reference to the ProCamera2D component or simply with
    Code (csharp):
    1. ProCamera2D.Instance.OverallOffset
    2. ProCamera2D.Instance.Axis
     
  11. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938

    Wanted to show you guys the new demo I'm working on which will be included with the package. ;)
     
    Async0x42, arkhament and Mr-Stein like this.
  12. arkhament

    arkhament

    Joined:
    Jan 24, 2015
    Posts:
    114
    OMG.. OMG!!!! look awesome!
     
    luispedrofonseca likes this.
  13. AlbertStr

    AlbertStr

    Joined:
    Feb 12, 2014
    Posts:
    13
    Hi @luispedrofonseca,

    I was playing with the camera since yesterday and it works awesome out of the box. But I have some questions, basically to know if there are some incompatibilities with helpers/plugins or I'm doing something wrong.

    First, I can't add a zoom in/out if Speed Based Zoom is enabled. Furthermore, if I enable Forward Focus, the zoom in doesn't take care of the target and it gets out of the screen.

    Second, is there any way to do that, when leaving a Camera Boundary, restore the original boundary?

    Thanks for the plugin and for your time!

    PS: Btw, I do not see Helpers icons like in the gifs of your page. Is that normal?
     
    garrot likes this.
  14. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hi @AlbertStr, thanks for purchasing ProCamera2D.

    1) The zoom-related plugins are indeed incompatible. This is because we can't really have multiple different sources trying to change the camera zoom at the same time. I'll make sure to update the editor to show a warning about this and the website as well.

    1.1) The Forward Focus shouldn't be causing any trouble with zooming. Can you send me a sample project that shows the issue? Or maybe a video?

    2) No, the camera boundaries triggers do not reset the boundaries on exit. Can you share a use-case where that would be helpful?

    3) The Helpers icons for the TriggerBoundaries are not showing up correctly sometimes. This issue has been fixed and will be part of the next update.

    Cheers!
     
  15. AlbertStr

    AlbertStr

    Joined:
    Feb 12, 2014
    Posts:
    13
    1) Yeah, sounds logic :D. We are using a very very smooth zoom with the zoom plugin, but you are right that with a more heavy zoom, it would not make sense. I think that I will write a little plugin to remove the Zoom plugin when you enter in a zoom helper :). Btw, nice plugin system, very easy to extend!

    1.1) I must say that we are using that with "cinematic" purpose, not really something playable, but that's what happens when I use a 2.4 multiplier zoom in:

    Editor config:


    When I walk in:


    2) Sure. For example, in the BoundariesTrigger scene, when I reach the highest platform, I can jump directly to the ground and lose the player until I enter to the ground trigger. I would like to recover my original Y minimum value when the player jump/walk off a boundary.

    3) Nice! Waiting for the next update! ;)

    Thanks!
     
    luispedrofonseca likes this.
  16. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @AlbertStr Your game looks amazing!! I'd really like to put it up on the showcase section of ProCamera2D website. If you're interested, can you please DM some more details?

    1) Thanks! Glad you liked the plugin system. I'm thinking about renaming them to extensions to avoid some confusion. :)

    1.1) I'll see if I can replicate that and figure out what might be wrong there.

    2) Yes, that makes total sense. But I'm not sure what would be a good solution... Maybe have the option to on trigger exit, go back to the previous value? Although, with this solution, on the example you gave, you'd still loose the player because it would revert back to the previous platform and not the ground level boundary... Any ideas what would be best?

    3) Coming soon! :)
     
  17. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    New version (1.5.3) just submitted! The improved Shake extension is the king on this update.

    • Upgraded Shake extension - Presets support, rotation and overall tweaks
    • Zooming with perspective cameras is now made by moving the camera instead of changing the field of view to avoid distortion
    • Fix TriggerBoundaries left and right gizmos incorrect size on XZ and YZ axis
    • Maintain pixel-perfect during shakes



    The Shake extension now supports rotation, presets and added a few more tweaking parameters. ;)
     
    Last edited: Oct 12, 2015
  18. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @AlbertStr The issue you mentioned above about the Forward-Focus and the Zoom-Trigger is now fixed and will be part of v1.5.4. Basically the Forward-focus wasn't taking in consideration the camera zooms when "Maintain Influence on Stop" was on. Please email me if you'd want to receive this update before it's approved by the Asset Store.
     
  19. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Hi Luis, the system looks great.

    Can I just check with you which of the plugins work together/don't work together?

    For instance, are you able to use Influence Triggers, Camera Window, and Boundaries Triggers in the same scene?

    And can Zoom triggers be used at the same time as Boundary Triggers?

    EDIT: We decided to just buy it and give it a go :)
     
    Last edited: Oct 15, 2015
    luispedrofonseca likes this.
  20. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hi @flashframe,

    Thanks for buying ProCamera2D!

    Pretty much all extensions are compatible with each other, with the exception of the zoom ones because you can't really have multiple zoom extensions trying to change the zoom at the same time. :)
     
  21. ArthurClark

    ArthurClark

    Joined:
    May 12, 2013
    Posts:
    15
    Hi! Just bought this component. So far I like it but I can't find any way of fluently zoom the camera manually/procedurally. I need a way to zoom the camera by rolling a mouse wheel and it must not be just a fixed changing of camera zoom back and forth, but rather a fluent translation. Is there any tool to accomplish that in ProCamera package?
     
    luispedrofonseca likes this.
  22. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hi @ArthurClark,

    Thanks for buying ProCamera2D!

    Although out-of-the-box there's no extension that zooms in/out based on the mouse wheel, you can easily build your own extensions to accomplish that. See this: http://www.procamera2d.com/user-guide/#going_beyond

    To alter the camera size in a smooth way, you can use the following method:
    Code (csharp):
    1. ProCamera2D.Instance.UpdateScreenSize(float newSize, float duration = 0)
    If you pass a duration larger than 0, the camera will automatically tween the values for you, giving it a smooth transition.
     
  23. ArthurClark

    ArthurClark

    Joined:
    May 12, 2013
    Posts:
    15
    Thanks! Will try!
     
  24. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    It's a really great asset. Clean, lightweight, well written and extensible. And really great value. Has saved me a ton of dev time already. Exactly what was needed! Thanks for making it.
     
    luispedrofonseca likes this.
  25. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Thanks mate! ;)
     
  26. ahmed_decoy

    ahmed_decoy

    Joined:
    May 19, 2013
    Posts:
    58
    Hey @luispedrofonseca

    Any plans to support 2D Colliders for Geometry Boundaries?

    Our use case is we have a 2D game where would like the camera to stay within boundaries of our level, but also make sure none of our playable characters exit the playing field. We wanted to use 2D Edge Colliders to define these boundaries.

    We can definitely do a workaround and create 2D Colliders for the players, and 3D Colliders for the camera. But it would be nice if we can just use 2D Edge Colliders for both. Numeric boundaries our not ideal for us since our level progress in multi-directional design.

    Thanks!

    upload_2015-10-17_12-27-0.png
     

    Attached Files:

    luispedrofonseca likes this.
  27. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hey @BrothaMan,

    In order for ProCamera2D to work in all axis (XY, XZ and YZ) I opted to use 3D colliders for the geometry boundaries because 2D colliders only work on XY.

    I understand in some cases, like yours, that is not ideal. I'll give it some thought and figure if there's a way to add an option that allows you to choose between 2D or 3D colliders.

    Although, I can't promise you it will be quick to implement. I'm currently working on v1.6.0 which brings some improvements and a couple new features, including a new re-designed website. After that is done though, I'll get into your request.
     
    Last edited: Oct 17, 2015
  28. ahmed_decoy

    ahmed_decoy

    Joined:
    May 19, 2013
    Posts:
    58
    No worries, not very urgent. Looking forward to v1.6.0!
     
  29. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Wanted to show you a sneak peek of what's coming up in v1.6.0.

    I've decided to retire the "Cinematic Focus Target" and turned in to a simple Cinematics editor. You can add any number of targets and define a ease in duration, hold duration and zoom per each. This allows you effectively create any type of cinematic in a very easy and quick way. Hope you guys like it! ;)

    procamera2d_cinematics_editor_1.png
    procamera2d_cinematics_editor_2.png
     
    Mr-Stein and superwendel like this.
  30. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Some more good news about the upcoming v1.6.0. Now, except for the very basics, ALL FEATURES are an extension. :) This means that the core is now even lighter and cleaner.

    procamera2d_extensions.png
     
    Async0x42 and Mr-Stein like this.
  31. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    luispedrofonseca likes this.
  32. Pericuelo

    Pericuelo

    Joined:
    Mar 1, 2013
    Posts:
    5
    Nice update! Like the new organization of extensions and triggers!
     
    luispedrofonseca likes this.
  33. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hey guys,

    As we're approaching the release of v1.6.0, I've finally finished the new demo. It's a simple top down shooter but it gives a good idea of how you can combine multiple ProCamera2D features together.

    http://www.procamera2d.com/demo_topdownshooter/

    Let me know what you think!
     
    Async0x42 likes this.
  34. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hey guys, in case you haven't received the Asset Store notifications, the v1.6.0 is now out!!

    Please notice that on this release I moved a few features from the core into their own extensions. More precisely, Camera Window, Numeric Boundaries and Geometry Boundaries. If you were using those features you'll have to update your settings accordingly. Sorry for the inconvenience, but the benefits of having pretty much everything as an extension are huge.

    Like mentioned above, another big feature of this release is the new Cinematics extension. Soon I'll write a blog post about it.

    I also did a revamp on the website and made a new Getting Started video:
     
    flashframe likes this.
  35. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    Hi, this asset grabbed my attention from the moment I saw it and now I'm considering getting it and using it in my project.

    I just have a couple of questions. :)

    1. How exactly is the pixel perfect effect achieved?
    2. What do the Game Viewport and Zoom setting affect in the Camera? (I'm using orthographic camera)
    3. Does the asset mess with the cameras render target?
    4. What does ProCamera2DPixelPerfectSprite exactly do to the Game Object? How does it mess with the Transform and scale?
    5. Does it matter that I'm using Pixel Snap on the Sprites material? Can we achieve pixel perfect without using the ProCamera2DPixelPerfectSprite?

    I have to ask these question since I don't know how the asset will interfere with what I'm currently doing in my project. All of my Game Objects are already snapped to the pixel grid positions. So mainly the animations and moving object won't be in pixel perfect position, but that has to be the case in my project.

    Cheers!
     
  36. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @Shadelss, thanks for your interest in ProCamera2D!

    1. The pixel-perfect is achieved by rounding the camera and your sprites positions to the pixel grid.
    2. The Game Viewport size is a difficult concept to grasp and maybe the documentation is not clear enough. Think of it this way: If you were to put your game assets (characters, trees, etc) on a image file that represents a view of your game, it would be the size of that image. So imagining your character has, for example, 8x8 pixels, your game viewport should probably have something around 80x50 pixels, in order to make the character with a reasonable size in relation to the world. A better name for "Game Viewport" would probably be "World View Size".
    2.1 The Zoom setting allows you to increase the size of your assets at a pixel-perfect rate.
    3. No, you can still use render targets.
    4. The PixelPerfectSprite basically runs on LateUpdate and rounds the position of your sprites to a pixel-perfect position. If it's a non-moving object it will only run on Awake. Your sprite should be made a child of your GameObject and then you can freely move the GameObject without worrying.
    5. Yes, you can achieve pixel-perfect without using the PixelPerfectSprite. As long as your GameObjects are positioned correctly on the pixel grid.

    Hope this helped you understand better how pixel-perfect is achieved in ProCamera2D. If you have any other doubts please don't hesitate to contact me directly or through this thread.
     
  37. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    Hey, thanks for the extremely fast reply! It definitely cleared stuff up. :)

    If I got it correctly, let's say I have a character that's 64x64 (10 pixels per unit import), and I've set the scene up in Unity so that 10 pixels are in 1 unit. And an orthographic size of 18 looks like what I want the view to be at.
    Does that mean the viewport size should be 640x360 (for 16:9) aspect.

    And If all my static sprites are positioned in the pixel grid, I just need to put PixelPerfectSprite on the moving sprites?

    I have some additional questions, if you don't mind. :)
    1. How does the asset mess with the Orthographic size of the camera? Is all zoom essentially adjusting the Orthographic Size?
    2. And I'm guessing it will be pixel perfect in all resolutions and aspect ratios (without black bars)? Or am I supposed to adjust the viewport size? (Technically you just need to know the orthographic size, pixels per unit and aspect ratio to set the viewport, if I got it correctly?)

    Cheeers!
     
  38. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @Shadeless, yes that is correct.

    1. Yes, zooming is done by altering the Orthographic size.
    2. Yes, it will be pixel-perfect in all resolutions without the need to adjust the viewport size (and without black bars).
     
  39. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    614
    hey is it possible to create an INFINITE parallax effect with this plugin?

    Also regarding parallax, correct me if im wrong but theres no way to have parallax if i use a 2D toolkit camera in default orthographic mode right?

    Id need to create a second camera in perspective mode and use the ProCamera2D parallax on that?
    And synchronize the 2 camera positions with each other?
     
  40. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Hi @luniac, ProCamera2D does not contain any script to create an infinite parallax effect.

    If what you're looking for is an infinite scrolling background, a simple script that repositions your gameObjects based on the camera position should be enough.

    As for 2DToolkit support, it is indeed fully supported. See this: http://www.procamera2d.com/user-guide/#2d_toolkit
     
  41. luniac

    luniac

    Joined:
    Jan 12, 2011
    Posts:
    614
    hmm so i can do something like 3 copies of the background next to each other and once the player reaches the midpoint between the 2nd and 3rd copies, i can move the 1st copy to the end of the 3rd one so it's seemless looping?

    or were you thinking of some other way?

    sorry if its stupid question, ive never done any parallax scrolling before.
     
  42. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @luniac Exactly. And ProCamera2D will take care of the parallaxing for you.
     
    luniac likes this.
  43. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Hey Luis,

    Enjoying the new features. One thought/request. the new cinematic plugin is really nice (love the letter boxing) but one feature that has been lost is the ability to leave the camera focussed on a cinematic target indefinitely.

    The old trigger allowed you to set the cinematic focus and then disable it later manually. I liked that functionality, since it provisions for situations where you're waiting for player input or another event before returning the camera to its original target, and you don't know for sure how long to hold the cinematic focus for.

    Would be cool to have an option where instead of a hold duration, you could set a target to hold until receiving a command to continue. Or is that possible already?

    Thanks!
     
    luispedrofonseca likes this.
  44. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @flashframe You are right! I actually didn't consider that use case with the new Cinematics extension. I'll definitely solve it somehow and make it part of the next update (v1.6.1). Thanks for the heads up!
     
  45. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    789
    Sounds great, thanks Luis!
     
    luispedrofonseca likes this.
  46. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Couldn't resist the birthday bonanza deal on this great asset, now I can throw away my 2D camera scripts as your package does include everything I wanted and even more.
     
    luispedrofonseca likes this.
  47. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @flashframe I have an update ready that adds the functionality you asked for.

    You can now hold indefinitely on a cinematic target by using a Hold Duration smaller than 0. I also added a method that allows you to manually skip to the next target. This should give you the same behaviour but in a way more cooler and flexible way. :) Thanks for the suggestion!

    I'm just waiting for the confirmation that I can upload it during the sale and not break anything. If you want it now, feel free to email me your invoice number and I'll send you an updated package.
     
    flashframe likes this.
  48. tinkergames

    tinkergames

    Joined:
    Nov 6, 2015
    Posts:
    3
    Hello @luispedrofonseca , your plugin is awesome!

    I've got a problem from the latest update with the "boundary trigger". The game I currently make is having the boundary triggers as the prefabs. I am doing so because the levels are saved as prefabs. There were no error on ver 1.4.1 of ProCamera2D, but after the update to 1.6.0 I have the error that makes the camera not bounded.

    The steps to replicate the error were like this:
    1. Load the ProCamera2D v 1.6.0
    2. Open the example in ProCamera2D/Examples/Scenes/TriggerBoundaries
    3. Select all the boundaries in the hierarchy and make it as a prefab. Put it on a folder named "Resources"
    4. Create a script that load the trigger boundaries and run the game
    The code to load the trigger prefab were like this:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class Instantiator : MonoBehaviour {
    5.  
    6.     public string location = "Triggers";
    7.  
    8.     void Start () {
    9.         GameObject go = Resources.Load(location) as GameObject;
    10.         GameObject instance = Instantiate(go);
    11.     }
    12.  
    13. }
    14.  
    The editor will pop up this error (same as attached image) :

    All the trigger boundaries scripts also would be inactive after doing this steps.

    I really need the trigger boundary to be functional after instantiated on prefabs. Hope there's workaround for it.

    Regards
     

    Attached Files:

  49. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    @tinkergames Thanks for reporting that issue. I'll investigate what's going on and get back to you ASAP.
     
  50. archwaykitten

    archwaykitten

    Joined:
    Jun 12, 2014
    Posts:
    14
    Is there a way to toggle off all of the helper lines and window boundaries and reticule lines during preview/test mode? I like seeing all of these things when I'm actively working with the camera, but when I'm working on something else all of this stuff is distracting. Thanks!