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

[Deprecated] Simple RPG Camera

Discussion in 'Assets and Asset Store' started by Ninjaxim, Oct 2, 2013.

  1. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Version 1.5.3 is now up for review.

    This update just includes a new setting under Rotation Settings called Mouse Look. This allows rotation without pressing any mouse buttons, and should allow the use of controllers easily as well.
     
  2. hamyshank

    hamyshank

    Joined:
    Jan 31, 2013
    Posts:
    88
    Thanks for the update!

    I'm not experiencing any of the jittering, I just found that in my case it was mainly the update functions being different. Using that sample asset third person camera, you should be able to see the difference. I have not tried the interpolate settings but I can report what I find if I do.
     
  3. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    I've decided to send the current version (1.5.4) to Unity for review, even though there is still a small issue I haven't fixed yet. I will be sure to get it fixed sometime soon.

    Changelog:

    Updated the custom inspector for SimpleRpgCamera + Mobile

    SrpgcLegacyPlayerController.cs:
    NEW: Editable animation names for custom animations
    NEW: Auto Run Key
    NEW: Run Key
    NEW: Toggle Run
    NEW: Mouse Lock Movement (Changes the way the player moves while holding right mouse button)
    NEW: Always Face Mouse
    NEW: Move Relative To Camera

    SimpleRpgCamera.cs:
    NEW: Joystick Support for Rotation

    Known Issues:
    Legacy Character Animation does not work correctly for the new Always Face Mouse function
     
  4. Stand Alone OS

    Stand Alone OS

    Joined:
    Feb 10, 2013
    Posts:
    3
    Amazing Asset!

    A friend of mine bought it a little while ago and is letting me play around with it.
    I seem to be having one problem though.... I attached the "Simple Rpg Player Controller" on the player and the
    "Simple Rpg Camera" on the camera, attached the target and Object to Rotate but I can't seem to be able to jump when I press the space key... Hmmm... Probably and simple newbie mistake... Any advice would be appreciated.
     
  5. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Be sure you have an axis called 'Jump' set up in the Input settings (Edit > Project Settings > Input). Otherwise I'm not sure what would prevent it from working.

    Out of curiosity, what version are you using?
     
  6. DeadHeadStudio

    DeadHeadStudio

    Joined:
    Jun 24, 2014
    Posts:
    2
    Best camera on the asset store, I love it.

    One suggestion would to have a few object(s) that you can click with the RTS Controller, For example a door or tree or something that the player can interact with, Just a starting point so other users can add there own interactive objects!

    Other then that amazing, 5 out of 5 Stars!
     
  7. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Thanks, glad you like it!

    That's a good idea, I'll think about adding that in the next update!
     
  8. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hi Ninjaxim,
    only few minute on it and I can say that it is a fantastic controller ... missing only a "Mouse Drag Pan".
    Max
     
  9. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Hello and thanks!

    I can add a mouse drag pan option, is there any specific way you would like it to function?
     
  10. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Could be nice to have the ability to choose an action for each mouse button..
    For example:
    (LMB) select a target to follow
    (MMB) pan
    (RMB) orbit
     
  11. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Alright, I've added a mouse drag setting but won't be uploading it to the Asset Store quite yet. It is however available on my website. If you register there (http://unity.phatrobit.com/) and send us your invoice number using our form (http://unity.phatrobit.com/user/myproducts.php) you can download the new update directly without waiting.
     
  12. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Thanks Ninjaxim ... this is a great news...i'm registering now.
     
  13. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hi Ninjaxim, I tried the new version and works very well...to be perfect could you add the same dumping effect (very nice) of zooming and rotating also for dragging (mouse or keys),edge movement and enabling the option to follows the target . Very handy package...compliments!
    Notes:
    - "Allow mouse drag" don't work if "Allow Keys" is disabled !
     
    Last edited: Oct 7, 2014
  14. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Ah I didn't notice, I will get that fixed! I will also add a smoothing option, thanks for the request!
     
  15. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Version 1.6 has been sent to Unity for review.

    Changelog:
    Updated scripts for Unity5
    Moved demo files to a better location

    SimpleRpgCamera.cs:
    Target Settings:
    NEW: Smooth Offset
    NEW: Smooth Offset Speed

    Rotation Settings:
    NEW: Auto Add Target To Rotate

    Movement Settings:
    NEW: Allow Mouse Drag
    NEW: Drag Button
    NEW: Drag Sensitivity

    Zoom Settings:
    NEW: Auto Add Target To Fade
     
  16. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Version 1.7 is now being reviewed by Unity and can be downloaded on my website (by those who register using their invoice number).

    Changelog:
    Updated ReadMe.pdf
    Added mobile settings to SimpleRpgCamera.cs, making MobileSimpleRpgCamera.cs obsolete.
    Removed MobileSimpleRpgCamera.cs

    SimpleRpgCamera.cs:
    Rotation Settings:
    NEW: Disable While Unlocked
     
  17. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hi Ninjaxim...there is an issue in the dragging in the last 1.7!
    EDIT: you can see it in your online web demo (RTS Demo).
     
  18. cjrussel14

    cjrussel14

    Joined:
    Jun 20, 2014
    Posts:
    69
    i bought it yesterday and i must say its a great camera for rpg makers, but i have one problem

    i am trying to copy the mouselook demo,,i am using a framework so i must do a little scripting to use it,, i manage to get it worked but the transparency didn't work,,when i zoom in into my character he didn't fade,i copy all the setting in the demo even the shaders and the material,, but it just dont work.. what does it contribute to make that fade option to work?
     
  19. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Apologies for the late response as I was away on vacation!

    I have just replied to your email about this issue, but again, be sure the materials on your objects are transparent (opacity controlled by alpha value).

    What kind of issues are you having, could you explain the problem a bit more?
     
  20. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Hi Ninjaxim,
    nothing too complex to explain ...using your last demo all dragging movement options (Key , screen edge, etc.) not work anymore.

    IIn depth Unity Editor usage:
    - new scene, new plane...new cube.
    - attach SimpleRpgCamera to camera
    - set the cube as target
    - play scene..all works normal
    - inside Inspector options "Allow Mouse drag, Edge Movement, Key" cause an position jump of the camera and then no other movement is allowed.
     
  21. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Found the issue...
    ...SimpleRpdcamera.CS - Line 727

    replace:
    Code (CSharp):
    1.   _focalPoint.position = moveDirection * Time.deltaTime;
    with:
    Code (CSharp):
    1.   _focalPoint.position += moveDirection * Time.deltaTime;
     
  22. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Ah, guess that plus symbol was removed by accident while I was merging the mobile stuff. That should indeed fix the issue, I'll send the fixed script to Unity.

    Thanks!
     
  23. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    You are welcome!

    wishes:
    - add damping movement when panning(like current Zoom and Rotate implementation) for ex. when stop dragging the camera don't stop immediately but continue a little bit before stopping.
    - add a smooth follow option after "follow target key" is pressed instead jumping directly to the target.
    - add click/double click (Tap/Double tap on mobile) on the target gameobject to follow and lock the camera on it.
    - add "current" Angle slider to set the initial angle position (Min, Current, Max like Zoom Distance settings)
    - add a graphical box on Scene Tab to display the current limit bounds settings to make easy the settings. Alternative calculate the bounds using custom mesh gameobject collider.


    By the way... great job on this tool!
     
    Last edited: Dec 26, 2014
  24. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Those are some nice ideas, I will add them to my todo list!

    Your last point about the limit bounds display should already be implemented. It shows a white wireframe box of the limited area. I will see about allowing custom mesh alternatives.

    Thanks!
     
  25. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    733
    Sorry Ninjaxim,
    I did not notice this feature ... for a curious reason i have SimpleRPGCamera Gizmos disabled in my scene view.
    Thanks!
     
  26. LNMRae

    LNMRae

    Joined:
    Dec 28, 2012
    Posts:
    48
    Hello! I purchased the Simple RPG Camera asset today and I have to say so far I am really loving it. It feels so smooth and there are so many great options to work with.

    I have a quick question; I'm wondering if it's possible to set it up where the camera will follow the character like with the 'Stay Behind Target' but it won't stick to the characters back completely. Right now, the 'Stay Behind Target' works really well, but I'd like it to not flip around so quickly when the character does a 180.
     
  27. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Hi! Thanks, I'm glad you like it!

    You can adjust the Smoothing option at the bottom of Rotation Settings (lower value = slower) and that will slow it down, though that also affects the rotation speed while using the mouse to rotate it. Would you like me to add a smoothing speed for the Stay Behind Target option?
     
  28. LNMRae

    LNMRae

    Joined:
    Dec 28, 2012
    Posts:
    48
    If you're taking requests, that would be great! I think that's exactly what I'm looking for. One of the things I like about the Stay Behind Target option over the Use Target Axis is that it works really well with using the mouse to turn, in case the player finds that more comfortable, so it would be great if I could keep the two different smoothing options separate. Thank you for the response. :)
     
  29. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Ok, I've added a Return Smoothing option that is active if either Return To Origin or Stay Behind Target is active. I've also added an optional Return Delay option so it returns only after the specified time (in seconds, 0 = instant).

    I've sent it to Unity for review which takes about a week. You can also download it instantly if you register on my website (here) and send us your invoice number (here) that you got from Unity after making your purchase.
     
  30. LNMRae

    LNMRae

    Joined:
    Dec 28, 2012
    Posts:
    48
    That sounds perfect, wow, I definitely didn't expect the request to be answered so quickly! That Return Delay option sounds really useful as well. Thank you so much!
     
  31. Defiant_Games

    Defiant_Games

    Joined:
    Jul 18, 2012
    Posts:
    6
    Hi, just purchased the asset and it is working very nicely for my use as an RTS type camera.

    I rarely buy assets as I like to control my own code, but so far it's been perfect.

    A small request. The allowing of edge movement works fine except it continues to scroll when your mouse leaves the game window. This occurs quite often when testing the game and moving the mouse over to the inspector window. I did a very quick fix on it, but would be obviously nice to have it in the official version.

    Many thanks on a great asset.
     
  32. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Thanks, glad you like it!

    I'll definitely fix this for the next version within the next couple of weeks. I'm currently away from my machine until next week.
     
  33. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    766
    Very nice Camera control.

    I just bought it and it saved us a ton of time.

    One question: In the zoom, I cannot set the minimum distance to 0, I would like to set it to 0 so that I can go in FPV mode.

    I changed the editor to allow 0, but after a few seconds, the player hangs, maybe there is a division by 0 somewhere.
     
  34. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    I will look into adding first person support. Setting the distance to 0 currently will prevent the camera from rotating (and possibly other issues).

    As a temporary solution, you could comment out line 535 in SimpleRpgCameraEditor.cs and set the min distance value to something like 0.01f instead of 0.
     
  35. goldbug

    goldbug

    Joined:
    Oct 12, 2011
    Posts:
    766
    Thanks, I tried that it works fairly well.

    I also suggest you raise a UnityEvent when entering FPV mode and another one when switching to third person view mode. Then a separate script can adjust controls and UI if necessary for each mode.
     
  36. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Version 2.1.0 is now being reviewed by Unity. It is also available on my website for instant download to registered users.

    Changelog:

    SimpleRpgCamera.cs:
    • NEW: Added CurrentRotation getter / setter
    • NEW: Added CurrentDistance getter / setter
    • NEW: Added new example scene (RPG Demo (Avoidance)) to show off new avoidance collision settings
    • Collision Settings:
      • NEW: Avoidance Layers
      • NEW: Avoidance Speed
    • Movement Settings:
      • FIX: Edge scrolling no longer continues to scroll when the mouse leaves the game window
     
  37. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings Ninja.

    This asset seems to me to be the best RPG camera/player controller setup that I have seen so far, both in the way it "feels" when using it and in the amount of features. However, I was wondering about something. I have been considering picking this asset up to replace the example Third Person setup that comes with Unity 5. However, we had to kind of "hack in" swimming. Any chance you could add swimming support to this asset? Users could work out a way to change the bool "IsSwimming" false or positive or whatever, when entering water, for example, if the animator and scripts are setup to receive the data and behave correctly.

    And another question I had. We want to use the camera setup from the demo called "Legacy RPG Demo". Does the Legacy mean like, old school like WoW controller, or does it mean it doesn't use Mecanim but the old legacy animator? And if it does use the Legacy animator, can it be setup to use Mecanim? Never liked that goofy control where when the player pushes back the character turns around and runs towards the camera, like the current Unity TPC example, which is also similar to the first setup offered in your demo, minus jump functionality.

    Awesome work so far on this great asset!
     
    Last edited: Jul 9, 2015
  38. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Thanks Tethys for your kind words!

    I will look into adding swimming support as well as jumping.

    It uses the Legacy animator as well as a different control style (similar to WoW), since the Legacy animations don't control the object's position / rotation.

    I don't see why not. I could possibly set up a new demo and maybe an extra script to help with that.
     
    Tethys likes this.
  39. muzerly

    muzerly

    Joined:
    Jun 24, 2013
    Posts:
    22
    Hi, This rpg camera is great, but the collision fade not work even use Toon/Transparent/Lighted shader. what shader you use in the website demo? it's looks different with you use in the example demo.
     
  40. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Glad you like it!

    The shaders used in the website demo should be the same as the included example scenes. Currently (as of v2.3.1c) the collision fade objects are just using the Standard Shader with the Rendering Mode set to Fade.

    What version of the package are you currently using? The newest version is not yet available through the Asset Store, so if you want it you can register on our website and enter your invoice number on the My Products page to get a download link to the current version.
     
  41. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings Ninja. We are looking at this asset again for the camera control. I have extended the Standard Assets Third Person Character and Third Person Controller a bit and now need a new camera controller. Do you see any issues using the camera control with a different character controller? In this case, I would be using the same RPG camera setup you used with the Mechanim example, but with my TPC script. Thanks!
     
  42. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Hello Tethys!

    You should have no problem using the camera with a custom character controller, mine are in no way dependent on each other. If you do have any issues feel free to let me know and I'll do my best to help you out!
     
    Tethys likes this.
  43. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Thanks, I pulled the trigger last night as the asset looked too good to pass up. :) Great asset, it's already live in my game less than 24 hours later! One thing it seems I might need to change - I want people to be able to zoom in closer than 1. On my previous cam I just set the offset above their head a little and it gives them a sort of First Person Type view if they zoom in all the way, without needing to fade anything. I see in the code however that it is clamped as I did try to change the float to just 0.1 but it rounds up to 1. Anywho, besides needing to change that one little option in code we love it!
     
  44. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Ah yeah, you should be able to disable the distance rounding if you comment out line 482 / 483 in PhatRobit/Simple RPG Camera/Scripts/Editor/SimpleRpgCameraEditor.cs

    EDIT: You may also need to change line 479 as the min value is set to 1.

    Glad to hear it's working for you!
     
  45. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings Ninja. For some reason, my scripts for SimpleRPGCamera don't have any code that deals with camera distance rounding anywhere around those line numbers. I checked both scripts to be certain. I do see one line in SimpleRPGCamera at 703 that looks like it is clamping the value. I wonder if I somehow have an older version, I just downloaded and implemented it on November 17th.

    **Edit - Just saw your package was updated recently, will get the newest, thanks!
     
    Last edited: Nov 30, 2015
  46. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Are you sure? The code for rounding is on line 482 and 483 in the SimpleRpgCameraEditor.cs script (or just do a search for Mathf.Round and you should find it).
     
  47. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    I looked at the Changelogs in documentation and discovered it served me 1.8.2 since I am on Unity 5.1 (refused to go to 5.2 after hearing about too many assets breaking in that version). I suppose it might be time to update - with a live game on Steam right now, and knowing Unity's tendency to break a bunch of stuff with updates, we have been hesitant since we use more than a few packages in our project heh.
     
  48. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Ah sorry about that, perhaps I will release it under 5.0 in the future to avoid requiring my customers to upgrade. I usually get the latest version of Unity when they release it.

    If you'd rather not upgrade Unity, you can grab the current release on our website here (after registering and entering your invoice number), or just send me an email with your invoice number and I'll send it to you.

    The latest package should work fine on any 5.x version of Unity.
     
    Tethys likes this.
  49. Ninjaxim

    Ninjaxim

    Joined:
    Jul 23, 2013
    Posts:
    105
    Version 2.4.0 is now undergoing review by Unity! It's also instantly available on my website for registered users.

    I have removed the old Unity 4 package (I never updated it anyway) and have uploaded v2.4.0 using Unity 5.1.0 to improve compatibility for those who aren't using the most recent version of Unity.

    Changes:
    • SimpleRpgCameraEditor.cs:
      • FIX: Collision Layer Masks are now placed into the correct tabs in the inspector
    • SimpleRpgCamera.cs:
      • Collision Settings:
        • NEW: Collision Clipping
        • NEW: Collision Near Clipping
        • NEW: Collision No Clipping
        • NEW: Collision Clipping Detection
      • Movement Settings:
        • NEW: Auto Drag Sensitivity (automatically sets sensitivity value between min and max based on zoom distance)
        • NEW: Min Drag Sensitivity
        • NEW: Max Drag Sensitivity
        • NEW: Movement Collision Layers (the focal point will collide with these layers, used in most cases to keep it above the terrain)
        • NEW: Movement Hit Distance
        • NEW: Movement Hit Buffer
        • NEW: Highpoint Detection
      • Zoom Settings:
        • NEW: Auto Zoom Speed
        • NEW: Min Zoom Speed
        • NEW: Max Zoom Speed
     
    Tethys likes this.
  50. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @Ninjaxim, does this latest update make it so that the camera will adjust to the terrain height when you're panning around the scene in RTS-style mode (i.e. not focused on the player)? Similar to how the camera behaves in Wasteland 2 or Divinity: Original Sin.