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] Game Camera: AAA camera solution

Discussion in 'Assets and Asset Store' started by reindeer-games, Jun 17, 2014.

  1. besttooo

    besttooo

    Joined:
    Dec 9, 2013
    Posts:
    6
    Hi,
    I don't know what I did but still could not using Zoom function.
    so I used RTS camera mode and I also enabled zoom function already.
    I have tried reveral times but It does not working. I am developing on mobile phone.

    Could you please tell me what I have to do?
    Thank you
     
  2. besttooo

    besttooo

    Joined:
    Dec 9, 2013
    Posts:
    6
    After building project, Zoom function is working now. I don't know why? 555
    so

    Do you have plan to add Rotate Camera function by using 2 fingers in RTS mode?
     
  3. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, great it works. I have a plan to add:

    * panning with two fingers
    * rotate with two fingers

    So yes, you will find it in the next updates.

    Regards,
    RG
     
  4. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, I completely overlooked your post, sorry about that. The A* pathfinding is not directly supported by this package, but I think it should be pretty easy to change the Unity navmesh to A*pathfinding, I will look into that. Thanks for feedback!
     
  5. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    I know that your demo was done on plane geometry not terrains.

    I purchased this game camera about 3 month's ago just wondering if you managed to sort out the jittering on steep terrains when slipping?
     
  6. besttooo

    besttooo

    Joined:
    Dec 9, 2013
    Posts:
    6
    Thank you so much :)
     
  7. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, unfortunately not, the character controller is based on Unity sample asset script with capsule and what needs to be done here is to create a raycast (spherecast) going from the center of the capsule down to the ground and offset that capsule from the ground until the jitter disappear. So the capsule will be let's say 0.2-0.5 distant from the ground, however it will require a complete rewrite of character motor, because the capsule cannot be pushed while in the air, adding velocity to the rigidbody will not work here. I still have it on the list but will just take more time to fix.
     
  8. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    36
    Hi,

    My final target is to control a camera without a game character, just the camera flying over the terrain, on mobile (touch input, no joysticks or pads). I purchased the Camera framework but I have real problems to make the included demos work on mobile (android).
    So what I need is rotation around the y axis, panning along y and z achsis and zooming (increasing/decreasing distance to current "forward" direction). I am having a hard time and could use some hints :) I think what I need is somewhere close to the RTS and/or the Orbit style. Unfortunately when testing the default "EventsScene" without modifications (i.e. including the game character) I can't test the RTS style properly on my mobile - I can't find a way to rotate the camera. And the panning seems very strange to me... sometimes it works, sometimes it doesn't.
    Any help/hints much appreciated!

    [Edit] I made sure that EnableRoration is checked in the RTSConfig script.
     
  9. besttooo

    besttooo

    Joined:
    Dec 9, 2013
    Posts:
    6
    I knew your point. I bought this asset because of that.
    It is working properly for me now. I am using RTS mode by using pan, zoom and pinch functions like Clash of Clans but now reindeer games is going to add 2 functions which are pan and rotate with two fingers for the next update. That's great.

    Did you try to build your project yet?
    Firstly, I could not use zoom function then I tried to build my project and It worked. You should try.

    For panning function, make sure that the Name of button in Buttons area is "Pan"(in Mobile Controls Script).
    For left and right panel, you don't want to set them(for your and my case) and now we just waiting for a function which is rotate with two fingers. That's it.
     
  10. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    36
    Hi besttooo,

    thanks for your input. Great to hear that it works for you, this gives me hope :) Though I can't even run the demos properly to see how the parameters work.

    Is there a special reason why setting the configuration for a camera in the editor is reset as soon as I run the game? This does not make sense to me. Perhaps I miss something here?
     
  11. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    make sure you press the 'save' button when you change the parameters, when the 'save' button has a red color it means that the changes will be discarded on the next run of the game.
     
  12. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    The rotating is not supported on touch screen yet. Try to load RTS layout in mobile controls game object, it will load the best mobile controls for RTS camera.

    mobilelayout.jpg
     
  13. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    36
    Thanks!

    Next questions...
    Starting with an empty scene, I add a Directional Light and an empty GameObject (let's call it SceneContainer) to my scene. I add a cube, a sphere and a terrain to this SceneContainer. Next steps:

    add the GameCamera prefab
    switch to "RTS" in the CameraManager Active Mode
    in the CameraManager, set the Camera Target to SceneContainer
    enable MobileControls and load the RTS layout from the MobileLayouts folder
    in the Input Manager, switch Input Preset to RTS
    in RTSCamera, adjust RTSConfig to my needs and save it
    run the game

    I see the following 7 exceptions:

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.SetCameraMode (System.String mode) (at Assets/GameCamera/Scripts/Config/Config.cs:112)
    RG_GameCamera.Modes.RTSCameraMode.OnActivate () (at Assets/GameCamera/Scripts/Modes/RTS/RTSCameraMode.cs:50)
    RG_GameCamera.CameraManager.SetMode (Type cameraMode) (at Assets/GameCamera/Scripts/CameraManager.cs:110)
    RG_GameCamera.CameraManager.Start () (at Assets/GameCamera/Scripts/CameraManager.cs:254)

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.IsBool (System.String key) (at Assets/GameCamera/Scripts/Config/Config.cs:231)
    RG_GameCamera.Modes.CameraMode.GameUpdate () (at Assets/GameCamera/Scripts/Modes/CameraMode.cs:234)
    RG_GameCamera.CameraManager.Update () (at Assets/GameCamera/Scripts/CameraManager.cs:267)

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.Update () (at Assets/GameCamera/Scripts/Config/Config.cs:156)

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.GetBool (System.String mode, System.String key) (at Assets/GameCamera/Scripts/Config/Config.cs:203)
    RG_GameCamera.Config.Config.GetBool (System.String key) (at Assets/GameCamera/Scripts/Config/Config.cs:221)
    RG_GameCamera.Modes.RTSCameraMode.UpdateDistance () (at Assets/GameCamera/Scripts/Modes/RTS/RTSCameraMode.cs:344)
    RG_GameCamera.Modes.RTSCameraMode.PostUpdate () (at Assets/GameCamera/Scripts/Modes/RTS/RTSCameraMode.cs:487)
    RG_GameCamera.CameraManager.LateUpdate () (at Assets/GameCamera/Scripts/CameraManager.cs:272)

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.IsBool (System.String key) (at Assets/GameCamera/Scripts/Config/Config.cs:231)
    RG_GameCamera.Modes.CameraMode.GameUpdate () (at Assets/GameCamera/Scripts/Modes/CameraMode.cs:234)
    RG_GameCamera.CameraManager.Update () (at Assets/GameCamera/Scripts/CameraManager.cs:267)

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.Update () (at Assets/GameCamera/Scripts/Config/Config.cs:156)

    NullReferenceException: Object reference not set to an instance of an object
    RG_GameCamera.Config.Config.GetBool (System.String mode, System.String key) (at Assets/GameCamera/Scripts/Config/Config.cs:203)
    RG_GameCamera.Config.Config.GetBool (System.String key) (at Assets/GameCamera/Scripts/Config/Config.cs:221)
    RG_GameCamera.Modes.RTSCameraMode.UpdateDistance () (at Assets/GameCamera/Scripts/Modes/RTS/RTSCameraMode.cs:344)
    RG_GameCamera.Modes.RTSCameraMode.PostUpdate () (at Assets/GameCamera/Scripts/Modes/RTS/RTSCameraMode.cs:487)
    RG_GameCamera.CameraManager.LateUpdate () (at Assets/GameCamera/Scripts/CameraManager.cs:272)

    [Edit]
    When I first build the game and then run it, I get 999+ exceptions.
     
  14. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    36
    Is there a way to enter a value > 100 in the "DistanceMax" fields?
     
  15. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Thanks for the reply. Not wanting to be an arse here but its kinda an important one to fix ! Although the solution you gave at first light seems expensive computationally.
     
  16. besttooo

    besttooo

    Joined:
    Dec 9, 2013
    Posts:
    6
    I think you have to put Character Controller at least one.
     
  17. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, that's really strange, it might something to do with script execution order, please try this:

    1. Go to Assets/GameCamera/Resources/Config/ and make sure there are config files in .json format, you should see there for example a file RTSConfig.json.

    2. Try to change a script execution order of the file RTSCameraMode.cs:

    Go to Unity Editor menu -> Edit -> Project Settings -> Script Execution order and in the inspector add RG_GameCamera.Modes.RTSCameraMode with value 1000.

    This is just a workaround, I try to do something about it, I haven't seen it before.

    Thanks for feedback.
     
  18. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Yes you can, open a file Assets/GameCamera/Resources/Config/RTSConfig.json and change value

    "DistanceMax": ["Range", 20, 0, 100],

    to

    "DistanceMax": ["Range", 20, 0, 500],

    Save the file and in the game click on RTSCamera game object and press 'Load' button.
     
  19. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Not necessary Character Controller, it can be any game object, even an empty one, GameCamera just needs some Transform to get initial position.
     
  20. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    I was testing GameCamera today and I couldn't reproduce those errors, I started with fresh install from asset store to the new scene with light, terrain, and other stuff and configured same as you described and everything worked perfectly.

    Which version of Unity do you use?

    The only thing I can think of is the script execution order. You can try to go to Script execution order dialog and set RTSConfig script to some low value (-1000) so it will be always executed first. But anyway it shouldn't happen like this, I will investigate this more.
     
  21. besttooo

    besttooo

    Joined:
    Dec 9, 2013
    Posts:
    6
    Hi,

    Is it possible to move the camera to my character in RTS mode by doing something or click at a button?
    Could you please tell me how to do that?

    I tried to do that many time and many ways but It did not work. :(
     
  22. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    if you want to move the camera on some event, you can use the event system, which works well with triggers, your character runs into some area and triggers the camera event, which can change the camera settings, or just look at some point in the scene.

    You can read more information about events in documentation:

    https://docs.google.com/document/d/...JIF4Cfsyaqk8/pub?embedded=true#h.pz3jo1ga0wmx

    Also there is an "Event" sample scene with the GameCamera project.

    To move camera to your character, I would recommend you to use LookAt event where you specify some close point from the trigger position as a "From Transform", it can be some empty game object in the air, and you character would be "To Transform".

    Regards.
     
  23. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    I just found that the latest version includes a bug that causes a problem in RTS camera mode, it is like you say, the character doesn't move on click, you have to hold the position in order to move. I just made a hotfix, please replace the file AIController.cs in Scripts/CharacterController, it will fix the problem, I will put it in next update soon.

    AIController.cs
     

    Attached Files:

  24. JohnnyBurbank

    JohnnyBurbank

    Joined:
    Jan 20, 2014
    Posts:
    2
    Was wondering what's the proper way with the Third Person Camera to re-center the camera behind the character? I see a reference to "Reset". Is that for the camera or for just reloading the game? I hit "R" and see it hit the "reset" block in Player.cs, but that doesn't appear to reset the camera behind the player. Any suggestions?

    Edit: To clarify, I mean, when the player character is not facing forward, I would like to hit a button (R3? Left Bumper?) to re-center the camera behind the player's facing direction. Thanks!
     
  25. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    I just uploaded new version to asset store 1.1.6, here are changes:

    1. Improved touch input, added rotation with two fingers, pan control, mobile layouts are updated
    2. Orbit camera with touch input improved
    3. Support for A*Pathfinding (more info in AIController.cs)
    4. Reseting third person camera.
     
  26. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi, newest version 1.1.6 contains reseting of ThirdPersonCamera, please update and you can find the control in Edit -> Project Settings -> Input, the name of control is "Reset". By default it is set to 'r' key, but you can change it to any controls you like.
     
  27. martensen7

    martensen7

    Joined:
    Aug 7, 2013
    Posts:
    2
    Hi, I would like to buy your asset GAME CAMERA but first need to know one thing. I have a charcater setup and movement too. If I setup your camera is that camera going to follow every direction I go with the character , I mean if I turn right 90 degrees is camera dynamicly going to follow the character or what will happen when I turn 180 degrees ? I am talking about mobile touch controls.
    I tried the demo apk on asset store but I wasnt able to move character with third person camera.
     
  28. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Hi again,

    i have a little problem and hope you can help me with your game camera solution.
    I want to make a top down rpg for ios and in theorie there is no problem with your asset as long as i use flat terrains for enemys. But when i want to use some little hills or such where my character can run on and he shoot on an enemy who is not at the hill he is simply shooting over the enemy and that is looking stupid ;)
    The same is happen when the player character is under the enemy only that he is now shooting into the hill under the enemy.
    I want to use the joystick system and not the touch to walk there system.
    What i see is if i use the touch to walk there system i can just touch an enemy who is in front of me but a little lower or upper and the player character is shooting to the right hight.
    Can you make the joystick system so it also knows that the enemy is lower or higher and shoot to the right hight?

    I do not know how you made this for the touch to go there system but thing you test the hight where the finger touched and give that information to the player character so i know that for my wish it would be not a simple (but for you also not so complicate i think) solution becouse you have to find the right hight for that direction the player is shooting by testing wich enemy is in that direction and choose the first one.
    I can not code this but hope you can and will do this as it can be a new feature to your asset and if you have this feature i think you have one that the others do not have. I bought some top down systems and no one can do this.

    Just looked at your asset store demo video again and in the second half of the video i can see that with the touch to walk there system it is working (the part where the zombies are coming).

    Edit:
    I do not think that it should also have new animations for this so it should only be a "litlle" code.
     
    Last edited: Feb 4, 2015
  29. borrowedLadder

    borrowedLadder

    Joined:
    Feb 11, 2015
    Posts:
    21
    Hey - I just picked up the asset last night from the asset store

    Is there any way to get it working with other scripts that need the inputs like InControl? (https://www.assetstore.unity3d.com/en/#!/content/14695)

    I really love InControl for handling inputs but it doesn't seem like the Game Camera and InControl will work nicely together. Is this something you could add or point me in the correct direction for how to make them play nicely together? I really don't want to lose InControl :)
     
  30. Mark Henderson

    Mark Henderson

    Joined:
    Oct 25, 2013
    Posts:
    41
    I've really liked this asset so far, but I'm struggling a bit to figure out how to exempt some input from controlling the camera.

    Specifically, I have a drag and drop based inventory system, and every time I drag an icon around, I also drag the camera around.

    I'm considering adding some logic to InputManager to disable "currInput.UpdateInput(inputs);" whenever the UI is being interacted with, but that will be a bit of a cludge.

    I've noticed that your demo scene also has this problem (interacting with the UI also interacts with the camera, although you don't use any drag movements in your UI).
     
  31. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Any news about including new features like for example mine ;)
     
  32. WillyJenkins

    WillyJenkins

    Joined:
    May 26, 2013
    Posts:
    2
    Awesome plugin, just what I need with multiple camera views!

    Quick question, I'm using Photo Networking and I have a script to instantiate a new player when the scene loads. I need to put the code after the player instantiation to set the CameraManager's CameraTarget in runtime to the newly created character transform. Anyone have any idea how to do this?

    Cheers.
     
  33. Nachtwind

    Nachtwind

    Joined:
    Jun 3, 2013
    Posts:
    14
    I am using built-in Networking and do the following:
    Code (csharp):
    1.  
    2.         Debug.Log("Spanwing");
    3.         GameObject player = (GameObject)Network.Instantiate(playerPrefab, spawnedObject.position, Quaternion.identity,0);
    4.         GameObject cm = GameObject.Find ("GameCamera/CameraManager");
    5.         RG_GameCamera.CameraManager rcm = cm.GetComponent<RG_GameCamera.CameraManager>();
    6.         rcm.SetCameraTarget( player.transform);
    7.         rcm.SetMode (RG_GameCamera.Modes.Type.FPS);
    8.  
    9.  
    but i suppose it is what you could do as well :)
     
  34. Nachtwind

    Nachtwind

    Joined:
    Jun 3, 2013
    Posts:
    14
    Hi,
    Excellent asset you wrote there, but i am currently running into a few hickups with it. Following your instructions kind of works, but not to the full extend. Right now i am trying to figure out how to make mouselooko work as seen in your examples. Setting the camera to FPS/TPS only barely helps as only when the mouse is locked i have some mouselook capability (very slow).

    Furthermore i still try to figure out to use GameCamera in multiplayer.. the most simple approach - to just have a camera manager prefab on the scene which players share - seems not to work as all users share the same input (hence when i walk the other players do so as well etc). Therefore i would like to know if there is some better way to use GC in Multiplayer. Spawn/Despawn is a good approach, but it lacks some more important parts as input ownership etc.
     
  35. super-cypher

    super-cypher

    Joined:
    May 10, 2014
    Posts:
    117
    has this been abandoned?

    how is it in unity5?

    thanks
     
  36. Konstantin_Plashkevich

    Konstantin_Plashkevich

    Joined:
    Jan 31, 2015
    Posts:
    7
    Please help, i upgrade to unity 5 and have some troubles in all scenes. Cave worm and Zombies can't walk and follow me now, they can just stand, attack and die. How to fix it?
     
    John-Lisenby and jonkuze like this.
  37. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    +1 Please Fix this Asset for Unity 5 Compatibility. I get an Input Error which makes the Character Unable to Move or take any Action at all, and the AI does not seem to work in Unity 5. Please Fix!
     
  38. John-Lisenby

    John-Lisenby

    Joined:
    Nov 8, 2013
    Posts:
    122
    I had the same issue. I reloaded input settings from Windows -> GameCamera -> Installer. I am having issues with NPC running in place and player aiming animations not working correctly since upgrading to Unity 5.
     
  39. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Author has not reviewed this thread since March 5th. Sadly I decided to Flag his Asset and Report his negligence. I just bought the Asset and it's totally useless. = \

    Where is the Refund button... -_-
     
  40. Nachtwind

    Nachtwind

    Joined:
    Jun 3, 2013
    Posts:
    14
    UNfortunately i bought it just a few days ahead of the U5 release.. looks like this thing is completely abandoned and the author is not reachable.. in such cases a refund button would be great...
     
    jonkuze likes this.
  41. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hello guys,

    first of all, my apologies for not responding in past months. Lots of things happened in my life and I just hadn't time for my Unity projects at all. Sadly it happened during Unity 5 release. Anyway, I have a good news for everybody. Everything is settled back to normal and I have just pushed brand new version to asset store, version 1.1.8 with Unity 5 support.

    GameCamera now supports Unity 4.6.4 and Unity 5.x.

    Problems I found during the Unity 5 upgrade:
    • Input manager data - installation window wasn't opened during the import, Unity5 ignored the script
    • Character Animator upgrade was messed up
    • Navigational data had to be regenerated
    • Cursor locking API changes
    • Zombies and Worms were unable to move due to API changes in NavMesh agent

    Installation is automatic, you should see an installation window that will copy the Input Manager data and Unity5 data in case you have Unity5. Remember you can always go to Unity menu Window->GameCamera->Installer and open the window again.

    I tested many scenarios but the project is getting bigger so if you find any problem with Unity 5 please let me know here. I will keep the project updated.

    Thanks for patience.
     
    jonkuze and gurayg like this.
  42. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Thank you! Much appreciated... better late than never. I understand life stuff happens, just grateful for a response and update finally. Sorry I flagged your asset, but I really thought you just abandon the project, along with many others i'm sure thought the same. Hope all is well, and thanks again for the Update will test it soon.
     
  43. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Thanks, let me know if you have any problems.
     
  44. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    Hi, I just purchased this and imported into unity5 however, I cant get the mobile controls to work. I enabled them and loaded a profile but the character doesnt move and the buttons do nothing.
     
  45. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,240
    Just got this and setting up the RTS camera. Mostly works great, but two questions:
    1) I don't have a Camera Target (there is no player-character; the player roams around without an avatar to interact with NPCs). How can I make it work without it creating a Dummy?
    2) When playing the scene, if I stop dragging the camera and let it sit, after about 30 seconds, it starts roaming around on its own. How do I prevent that?

    thx
    Dave
     
  46. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    A playa like me got it to work finally.
     
  47. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Great, the mobile controls should work properly, I just retested again.
     
  48. reindeer-games

    reindeer-games

    Joined:
    Mar 5, 2013
    Posts:
    547
    Hi,

    1) for RTS the camera target is necessary for setting initial camera position. It does not have to be the character, just an empty object.

    2) Is it possible that you hit border of the screen by mouse? The camera shouldn't move by it's own without input. Especially in editor, when you move the mouse outside of game window it starts moving like in RTS game. You can temporarily disabled ScreenBorderMove in RTSCamera settings when using Editor, it can be annoying, and enabled it back when you build the game for your target platform.
     
  49. Konstantin_Plashkevich

    Konstantin_Plashkevich

    Joined:
    Jan 31, 2015
    Posts:
    7
    I have one more trouble, Crouch Height Factor doesn't work. I change it and see no difference, my char can not duck under anything.
     
  50. Nothnless

    Nothnless

    Joined:
    Oct 10, 2014
    Posts:
    38
    Can you add health pickups, a couple of different weapons and weapon switch swipe for mobile TPS?