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:
    827
    flashframe likes this.
  2. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    44
    I'm running unity 5.5.2f1 and playmaker 1.8.3 and pc2d 2.3.3

    I also can't get the actions to show up in the actions list... was there a solution for this?

    I've tried many times to remove and reinstall the pc2d actions, and even pc2d itself breaking all my camera setups in the process... and the actions still won't show up in the actions list...
     
  3. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @HeathC The reason you're not seeing the actions on your list is because you need to add the following to your "Script Defining Symbols":

    PC2D_PLAYMAKER_SUPPORT

    This is explained in more detail here: http://www.procamera2d.com/user-guide/3rd-party-plugins-support/#playmaker

    However, I just realised that the latest actions are not correct and conflict with the updated Shake extension in v2.3.0. So, please contact me directly and I'll send you an updated version that corrects this. This fix will be part of the next update (v2.3.4).
     
  4. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    76
    Hi Luis!

    I have encountered what it seems to be a bug on ProCamera2DRooms.
    I've activated Restore On Room Exit expecting the camera to focus on the camera's target (the player in my case) after leaving a room. But when I leave a room, the camera behaves in unexpected ways:



    Is like if the camera tweens to an unknown point, then when the tween finishes, the camera focuses on the expecte target.
     
  5. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @grogshotgames That does seem weird. However, notice that the "Restore On Room Exit" option is simply to restore the camera to its original boundaries before it entered the current room.
    Any how, can you please contact me through the support page (http://www.procamera2d.com/support) and send me a small sample project that replicates the issue?
     
  6. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    76
    ok so if Restore On Room Exit does that, how can I achieve an efffect that when I kill all the enemies in a room I remove the numeric boundries for that specific room so the camera is no locked?

    I've tried before by setting usenumericboundries to false, but there is no tween transition and it looks to bad. Any chance that you can add a transition?
     
  7. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @grogshotgames An easy way to accomplish that would be to have a larger room that contains the smaller one. Once you're done with it, simply remove the small room and the camera will transition to the larger one containing it.
    Let me know if that works for you.
     
  8. grogshotgames

    grogshotgames

    Joined:
    Aug 6, 2015
    Posts:
    76
    That would be a very complicated solution to a simple problem. All I want is to be able to tween between using numeric boundaries and not using them. So, the same way it works when you enter a room, but when you exit it instead.
    Do you think know if that would be possible?
     
  9. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @grogshotgames I understand your point, but that's not the way the numeric boundaries are built to work.
    The solution I gave you is very straightforward, you simply need to add one more room that includes your smaller ones. Just make sure the larger one has a lower index by reordering the list.
     
  10. Khudere

    Khudere

    Joined:
    Jun 7, 2014
    Posts:
    7
    Question: I was trying to disable the camera through a script when said GameObject is loaded. Is there any way to do this?

    I was trying to access it by grabbing it from the MainCamera but it doesn't seem to want to find the script.

    Example:

    public GameObject ProCameraScript;

    private void Start {
    ProCameraScript.GetComponent<ProCamera2D>().enabled = false;
    }
     
  11. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @Khudere That should be working. ProCamera2D's main class is a Monobehaviour like any other, so you can grab it using the GetComponent method.
    However, for convenience, you can use:
    Code (CSharp):
    1. ProCamera2D.Instance.enabled = false;
     
  12. Khudere

    Khudere

    Joined:
    Jun 7, 2014
    Posts:
    7
    I forgot to include
    Code (CSharp):
    1.  using Com.LuisPedroFonseca.ProCamera2D;
    it works now
    Thanks!
     
    luispedrofonseca likes this.
  13. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    Zehru likes this.
  14. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    568
    @luispedrofonseca Yes, this looks like exactly what I was looking for. Just in time too, as I'm just about to pick-up the project for which I needed it. :)

    I've only looked at the GIF so far as I'm at work, but I'll dig into the details soon and let you know if I have any issues.

    -Jeff
     
  15. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @jeffweber The soft boundaries are not part of the currently available version. I'm getting feedback and making the final adjustments before release. Contact me through support so I can send you a link with the beta version.
     
  16. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    568
    I'm close, but not quite ready to start using ProCamera again. Once I am, if the new version isn't out yet, I'll contact you for the beta.

    Thanks.
     
    luispedrofonseca likes this.
  17. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    After gathering some feedback and doing a few adjustments I just submitted the v2.4.0 that contains the soft boundaries feature. It should be up early next week.
     
    Zehru and Bagnol like this.
  18. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    882
    Hi there Luis,

    (premise: I haven't had a look at the updated docs yet)

    The introduction of the screen shake was indeed welcome.
    Yet, I was hoping for something more... parametric rather than using assets for separate intensities and shakes.

    Which, in my opinion, are fine, as long as you are also able to fade in/out/from/to 0 or from any of the assets.

    with the version before the current publicly available one, I had a critical issue:

    Since my Main Camera with the ProCamera2D component is persistent, as soon as it creates the extra objects needed for the screen shake to take place, it creates them in the scene, instead of inside the Dontdestroyonload space.

    So the camera can't cross-reference those among scenes and creates all kind of errors.
    could you please parent everything to the same GameObject of the PC2D so that we can have persistent ProCamera2D cameras?

    Are there public methods to trigger parametric screen shakes created and changing at runtime, without having to create presets?
    (screen shake amount and parameters depends on time (incoming earthqueake) and external events (explosions))

    Are we already able to mix or fade current screen shake assets? (for instance: triggering a quake at 25% intensity, then fading to 0 in 4 seconds, then going to full power in 2 second, only to fade to another preset "Armageddon" at 50% intensity in 6 seconds? )

    The only workaround I can think of is having a separate cameraTarget shaking randomly, and tweaking its weight.

    Thanks for your time :)
     
    Last edited: Apr 10, 2017
  19. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @NeatWolf If you put your ProCamera2D camera inside a parent that has a "DontDestroyOnLoad" component, the camera will persist across all scenes and everything should work. Are you doing this? What issues do you get?

    For a more manual control over the shakes, you can use the "Shake" method of the extension.
    Shakes are "mixed" by default. If you fire a shake while other is still running, they both run at the same time.
     
  20. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    882
    I have the GameObject that contains the cameraPro2D on the root, and is an object that has been marked as Dontdestroyonload, so it carries all the filters among all scenes.

    Nesting it inside a dummy object is definitely doable, even if, with a project that is going to hit the stores in days, is a change that may or may not have consequences.

    Wouldn't it be possible to have Camera-logic-related objects nested inside the camera object instead of having them as siblings? It kind of...alters the hierarchy in an undesirable way.

    Nice, I will probably use the Shake method, I'm going to have a look at the docs, hopefully it's not just burst only but also has constant behaviour :)
     
  21. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @NeatWolf What do you mean with Camera-logic-related objects? You mean the Triggers? Everything else besides the triggers are already, by default, under the ProCamera2D gameobject. The triggers need to be outside because otherwise they'd move together with the camera.

    The "Shake" method is only for bursts, but you can always create a ConstantShakePreset at runtime and pass it to the "ConstantShake" method.
     
  22. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    Hi guys, ever since I launched Pro Camera 2D I've wanted to create a forum. I've always postponed it because I never thought the ProCamera2D community would grow so much. After getting a few requests for it in the past weeks, I've finally did it.
    You can find it here: http://procamera2d.proboards.com
     
    Zehru likes this.
  23. Nikaas

    Nikaas

    Joined:
    May 30, 2013
    Posts:
    90
    Hi,

    I noticed that the left and right camera movement are not symmetric when using Forward Focus with enabled both Progressive and MaintainInfluenceOnStop. It doesn't matter if Im using transform or rigidbody2d.velocity movement.
    Actually there are 2 cases:
    1) character controller uses FixedUpdate: then setting camera to FixedUpdate works fine, setting to LateUpdate camera movement becomes somewhat non-symmetric.
    2) character controller uses Update: then setting camera to FixedUpdate makes left and right camera movement become extremely non symmetric, if camera is set to LateUpdate its same as in case1 (i.e. somewhat non-symmetric)

    If one of the 2 (Progressive or MaintainInfluenceOnStop) is false then Forward Focus works fine.

    Here is a video:
    - from start up to 0:30
     
  24. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @Nikaas, I'm not sure what you mean with symmetric.

    Anyhow, when your camera targets move on a FixedUpdate, you need to set ProCamera2D to also move on FixedUpdate. If they move on Update or LateUpdate, you need to set the camera to move on LateUpdate too.
     
  25. Nikaas

    Nikaas

    Joined:
    May 30, 2013
    Posts:
    90
    OK, i will make another video where it is more apparent. Character movement is now in Update, camera is set to LateUpdate. Changing between translational and rigidbody2d based movement have no effect.

    Notice the difference when character is moving left and right - you can look at the influence vector, or alternatively how far the character is from the middle of the screen, or how close the character is to the clamping lines (both left and right focus are at 0.25).
    You can see at bottom-left that character movement is identical on left/right.

     
  26. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @Nikaas, I see what you mean but I can't replicate it on my side. Can you replicate it on the included demos?

    I see you have other scripts attached on your camera. Maybe those are interfering?
     
  27. Nikaas

    Nikaas

    Joined:
    May 30, 2013
    Posts:
    90
    No , here is the code from the only component:

    Code (CSharp):
    1.     public class CameraMode : MonoBehaviour
    2.     {
    3.         [SerializeField] private Camera cameraMain;
    4.         [SerializeField] private Camera cameraVirtual;
    5.         [SerializeField] private RenderTexture renderTexture;
    6.  
    7.         [SerializeField] private CameraType activeCamera;
    8.         public enum CameraType
    9.         {
    10.             Main,
    11.             Virtual
    12.         }
    13.  
    14.  
    15.         public void ChangeCameraMode(CameraType activeCamera)
    16.         {
    17.             if (activeCamera== CameraType.Main)
    18.             {
    19.                 cameraVirtual.gameObject.SetActive(false);
    20.                 cameraMain.targetTexture = null;
    21.             }
    22.             else if (activeCamera== CameraType.Virtual)
    23.             {
    24.                 cameraVirtual.gameObject.SetActive(true);
    25.                 cameraMain.targetTexture = renderTexture;
    26.             }
    27.         }
    28.  
    29.     }
     
  28. Nikaas

    Nikaas

    Joined:
    May 30, 2013
    Posts:
    90
    @luispedrofonseca , I was able to replicate it on the Forward Focus example but it's much subtle there. You need to set core X smoothness to 0 (smoothness masks it), FF left focus to 0.5, right focus to 0.5.
    You must move the character form one end to another and its more about the speed of reaching the clamp values, it's really subtle. Try setting speed multiplier to 0.9, may make it a bit more apparent.

    I'm almost sure that same happens on Y, but its very difficult to test Y on platformer game.
     
  29. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @Nikaas I tried to replicate it using those settings but I really can't notice any difference at all. Can you please send me the scene file (through PM) with the settings you used?
     
  30. Nikaas

    Nikaas

    Joined:
    May 30, 2013
    Posts:
    90
  31. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    113
    Hello, your work is excellent but I have a doubt.

    I've seen that you can lock the camera to 2 axis (XY, XZ, YZ). With this in mind is it possible to make scene rotations, similar to those in Fez, Tomba/Tombi or Megaman 2.5D as seen in this video 5 seconds in?


    Thanks in advance
     
  32. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @SVC-Games Changing orientation axis at run-time is not something I anticipated so one of the methods you'd need is currently private. I'll make it public for next release.
    Any how, in theory this kind of movement should be possible to achieve but it's not very straightforward.
     
  33. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    113
    mmm what If I had several cameras. I could have ProCameraA, ProCameraB (in another location, looking at a different angle) and a "transition camera (TC)". When "ProCameraA" reaches the position of the "TC", it will turn off (IE: Stop rendering), "TC" will begin to render and move to the position of "ProCameraB", and THEN turn off "TC" and turn on "ProCameraB"

    One downside I see is that I would be forced to use ProCameras at 90º angles, am I right?

    Also, can I "tilt" the camera (as seen in megaman 2.5D trailer when climbing stairs)?

    What about something like bug for the saturn, can I move the camera in Z axis using rails?
     
  34. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hi, I am thinking of buying this asset. It is possible. Is there a demo, or any tutorial videos? If not, is it possible to get a PDF manual so that I can read about what this asset can do and see what's involved in using it?
     
  35. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @SVC-Games That would be a good idea. Moving the camera in the depth axis is only supported for zooming and not for following a character.

    @TokyoDan You can find all the info you need (including demos) on the website at www.procamera2d.com
     
    SVC-Games likes this.
  36. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    @TokyoDan You can find all the info you need (including demos) on the website at www.procamera2d.com[/QUOTE]

    Thanks. The reviews said your support was fast. Wow. Really fast!
     
    luispedrofonseca likes this.
  37. SVC-Games

    SVC-Games

    Joined:
    May 21, 2013
    Posts:
    113
    What I understand is that because I'm locked with XY, XZ or YZ I can only work with camera looking at 90º angles and not, say, a 45º angle degree, right? Just like in the megaman video where it changes from front facing (0º) to side view (90º).

    What about tilting the camera(IE: rotating the camera but locked into a plane for movement)
     
  38. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @SVC-Games Camera tilting outside of the 90º angles, is not officially supported. I say officially, because while most things still work as expected, there are some extensions that depend on those orientations and some calculations will be offset depending on how far you go from those 90º angles.
     
    SVC-Games likes this.
  39. redmau

    redmau

    Joined:
    May 5, 2015
    Posts:
    2
    Hi Luis. I'm struggling to get the camera to return to its original position after shaking with pixel perfect enabled. When I disable pixel perfect, it returns fine. Is this a bug, or am I missing something?
     
  40. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @redmau What ProCamera2D and Unity versions are you using? Can you replicate it using the included demos scenes? If so, please contact me directly through the support email (http://www.procamera2d.com/support) for easier tracking.
     
  41. redmau

    redmau

    Joined:
    May 5, 2015
    Posts:
    2
    @luispedrofonseca Thanks for the prompt reply. Was using the latest version of ProCamera2D and Unity 5.6.1f1. Seems to only occur with certain settings. Enabled shake in the Pixel Perfect demo scene and the GunShot preset was fine, but SmallExplosion and LargeExplosion had issues with getting back to the original position. PlayerHit would occasionally be off as well. Will contact you via support.
     
    luispedrofonseca likes this.
  42. DavidSmit

    DavidSmit

    Joined:
    Apr 1, 2014
    Posts:
    50
    Hi!
    Is there a way to have the Zoom method in code override the TriggerZoom in a nice way? I'm trying to overwrite it for the start/end sequence of my game, but the Triggers seem to very stubbornly take control.
    Thanks!
     
  43. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @DavidSmit The easiest way is to simply turn off your trigger during the sequence.
     
    DavidSmit likes this.
  44. DavidSmit

    DavidSmit

    Joined:
    Apr 1, 2014
    Posts:
    50
    Thanks! It mostly works now.
    I had to Stop all the coroutines on the triggers as well, otherwise there was an infinite zoom loop.

    Now when I re-enable the triggers, they don't always seem to register, atleast when the target is already in the trigger when it is being activated.. Any thoughts? :)
     
  45. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @DavidSmit You should use the Toggle method instead. Disabling the gameObject is not the right way to do it. Sorry for not mentioning it earlier.
     
    DavidSmit likes this.
  46. Aenah

    Aenah

    Joined:
    Apr 1, 2013
    Posts:
    29
    Hello everone.

    I bought this asset few hours ago, and I have doubts about how to do one thing. In my scene, I need divide the screen in two parts: one for UI and one for the game.

    upload_2017-7-7_23-23-34.png

    If you see it, the white side is Unity UI, and the little side at left is the game (some 2D Sprites). So, I want my camera centers on my target (one of the sprites), and that works fine, but my UI is over the target. I need see the target, so I set the Offsets properties (OffsetX and OffsetY) for moving camera and see my target in the left side. My problem is that the Offset`s values works fine in my original resolution, but they are not suitables when the screen resolution is other one.

    Someone can help??

    Thanks a lot.
     
  47. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @Aenah You can set the camera offset using relative values (screen space), and it should give you the results you're looking for independently of the current resolution. Have you checked the "Relative Offset" option right below the offset values?
     
  48. Aenah

    Aenah

    Joined:
    Apr 1, 2013
    Posts:
    29
    Thanks for your response.

    Yes, Relative Offset is activated and works fine. I realized that the issue is in my UI logic, not in Pro Camera 2D asset.

    Sorry for wasting your time.
     
    luispedrofonseca likes this.
  49. nsfnotthrowingaway

    nsfnotthrowingaway

    Joined:
    Feb 18, 2016
    Posts:
    46
    I'm trying to use Camera Window with Zoom to Fit. Zoom to Fit's default behavior is almost exactly what I need, but there are some game objects that are constantly making minute movements like jumps, or patrols, so I wanted to use Camera Window to ignore these movements. However, it seems like Camera Window is based off the center point of the camera instead of on all the Camera Targets, so Camera Targets can completely leave the screen as long as the camera's position is in the window. Is there a setting or extension that works like Camera Window, but with Camera Targets instead of the camera center point, so if all targets are within the Camera Window the camera remains, but if any object leaves the window it allows the normal camera scrolling, and Zoom to Fit to do it's job?
     
  50. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    827
    @nsfnotthrowingaway What I recommend in such case is to adjust a camera target influence based on their actions. So, if one of your targets needs to exit the camera for a while simply, set its influence to zero and then reset it back to one when he's back.

    Also, notice that the ZoomToFit extension has a "dead zone" between the zoom in and zoom out values where the camera doesn't move if the targets are in there. Maybe you could play with those values as well. Really hard to tell without knowing exactly how your game works.
     
unityunity