Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Camera Controller Release

Discussion in 'Assets and Asset Store' started by Tryz, Dec 21, 2013.

  1. clarHandsome

    clarHandsome

    Joined:
    Mar 26, 2017
    Posts:
    9
    Based on the existing 3rd person fixed motor (OrbitFixedMotor) and Top-Down View Motor(WorldMotor), here's my version of MOBA camera that supports rotation.

    Usage:
    1. Put WorldRotationMotor.cs somewhere in your Assets folder.
    2. In Camera Controller, add "Rotating Top-Down View Motor", and tick both checkboxes on this motor.
    upload_2019-1-22_2-49-13.png

    3. Override the Anchor with an exisiting gameobject. Usually it would be an empty GameObject at the center of your map.
    upload_2019-1-22_3-16-3.png

    4. In Input Source, set "View Activator" as "Right Mouse Button".
    upload_2019-1-22_3-3-45.png
    Now your can hold left mouse button to grip, and right mouse button to rotate.
     

    Attached Files:

    Last edited: Jan 22, 2019
    TeagansDad, hopeful and Tryz like this.
  2. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    @clarHandsome that is awesome. Thank you so much.

    Do you want me to add it to the Vault where I share free stuff from me and others?
     
  3. inthemilkywat

    inthemilkywat

    Joined:
    Dec 29, 2013
    Posts:
    54
    I'm having problem with camera not following anchor when running on android device. Everything works fine in the editor but the camera does nothing after building. I created a simple camera follow script and that works on device without any problems. Not sure what the problem is.
     
  4. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Odd. I used it on Android about 3 weeks ago with no issue. This weekend I'll try again.

    Please send tim@ootii.com your Unity Order ID and any other details... Version of Unity, settings, etc. Thanks

    [EDIT]
    I didn't have a problem with Android using Unity 2018.3.0f2. Once I the email, I'll test with those setting.
     
    Last edited: Jan 26, 2019
  5. erpatton

    erpatton

    Joined:
    Oct 6, 2014
    Posts:
    49
    Hi! So I'm trying to use the Look At Motor to lock onto an enemy target, but I'm having issues. I'm wanting it to behave like Dark Souls' lock on camera where the camera stays behind my character and the rotation just tracks the enemy target. Instead, the camera zooms to my feet, and setting an offset does some crazy stuff. I'm attaching a video so you can see my settings and what I'm experiencing. I haven't modified any code and have only added code for activating the motor and setting the target Transform. What the heck am I doing wrong here?



    Edit: I should mention that I read through the documentation, but I didn't see the Look At Motor mentioned, so I couldn't find any answers there.
     
    Last edited: Feb 6, 2019
  6. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    @erpatton - Use a 3rd Person Fixed Motor, rather than a Look At motor. I think that one just points at a target and not much else.

    Are you using Motion Controller? If so, there is an Advanced Camera Rig prefab that has my setup for different camera states. I think the Character Wizard selects it by default if you check "Use Camera Prefab." If not, no worries... I'll try and grab a couple screenshots of the settings tonight.
     
    Last edited: Feb 6, 2019
  7. erpatton

    erpatton

    Joined:
    Oct 6, 2014
    Posts:
    49
    @TeagansDad - I'm using a 3rd Person Fixed Motor for my normal camera that follows my player around. I thought the Look At Motor was for when you wanted to have the camera look at a target while still following your player. I don't see options in the 3rd Person Fixed Motor for setting a target while still keeping your player as the anchor.

    I own the Motion Controller, but I'm not using it here. If I import it, is that prefab in a specific folder that I can grab without bringing everything else in? And the settings are made for the camera locking onto an enemy aka Dark Souls/Zelda/etc.? I'm making a very light-weight controller and didn't need the robustness of the Motion Controller for what I'm working on with this one. If not, I'll try bringing it into another project so I can look at the settings.

    Edit: The behavior I'm looking for is around here in this video. The camera follows the target as the player moves around it:

     
    Last edited: Feb 6, 2019
  8. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    The Look At Motor is relatively simple and stays fixed on its target... It doesn't follow the player, nor does it handle collisions.

    There aren't actually any options on the 3rd Person Fixed or Follow Motors for setting a target while keeping the player as the anchor. Motion Controller achieves the behaviour that you're looking for (with the Sword & Shield Motion Pack) with a combination of components. The Combatant component handles setting and releasing a target lock (but doesn't change camera or movement controls itself); when the Combatant component locks on to a target, the BasicWalkRunStrafe motion activates and in its Update() method, it rotates the player towards the target. So the camera itself remains anchored to the player and doesn't actually care about the targeted enemy. ;)

    The camera prefab that I mentioned is this one:

    upload_2019-2-5_21-45-9.png

    It uses transition motors to move into and out of the locked-on state (similar to moving into and out of the Targeting state in the Archery Motion Pack):

    upload_2019-2-5_21-47-42.png

    If you're trying to get melee combat set up without a lot of fuss, I'd recommend importing Motion Controller, Camera Controller, and the Sword & Shield Pack into another project and run the Character Wizard to set up a melee fighter. It was designed to let you get a playable character up and running with as little required input as possible (you can configure some settings in Advanced Mode, and of course you can tweak the settings after). You can use the tool to set up an NPC as well, and you can test out the lock-on behaviour.
     
    Tryz likes this.
  9. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    @TeagansDad is right. What you have in your head isn't what the motor was designed to do.

    I give an example of the Look At motor in the web demo and talk about in the docs. Don't have the page number handy right now.

    However, there is a SetTargetDirection() function on the Camera Controller you can use to override my rotations and force a lock on like what you describe. Just ensure you call it every frame after the player and Target move. Otherwise you may stutter due to order of operations.
     
    TeagansDad likes this.
  10. erpatton

    erpatton

    Joined:
    Oct 6, 2014
    Posts:
    49
    Thanks guys! I've got it working with the 3rd Person Fixed cam and the SetTargetDirection() method.

    I did have one more question about the 3rd Person Fixed camera's behavior: I'd like the movement of the camera to "lag" a bit behind the character when they move. So if they move left while locked on, for instance, the camera would trail a bit behind them to the right, allowing a clearer view of the enemy while strafing around it.

    Is there any way to do that out of the box, or will I need to update something in the OrbitFixedMotor class to allow for that kind of tweening?

    Edit: Nevermind, I just added it to the RigLateUpdate (and added two new variables for setting it up):


    Code (CSharp):
    1. if (IsLockedOn)
    2. {
    3.         var zeroVel = Vector3.zero;
    4.         var smoothedPosition = Vector3.SmoothDamp(mRigTransform.Position, lNewCameraPosition, ref zeroVel, camSmoothing * Time.deltaTime);
    5.         mRigTransform.Position = smoothedPosition;
    6. }
    7. else
    8.         mRigTransform.Position = lNewCameraPosition;
    It seems to be working well with a value of 5 for the smoothing.
     
    Last edited: Feb 8, 2019
    Tryz likes this.
  11. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Another way of doing it is by using a separate object. So the object follows the character and the camera follows the object. I call this object an anchor.

    I include a "Camera Anchor" component that does this. Search www.ootiigames.com for more info.

    It's an easy approach.
     
  12. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    374
    Does it work with Rewired input system? When I enable Xbox is Enabled it doesn't work correctly for me.
    Also how should I move camera forward/backward with mouse scroll instead of zooming In/out?
     
    Last edited: Feb 10, 2019
  13. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Yes... using an Input Source that is custom to Rewired. There is one on the Vault (that I didn't create).

    To learn about Input Sources, check out this post.

    hmmm.... It's working for me and everyone else. If you're using a wireless Xbox controller, make sure you have the drivers installed or Unity won't recognize it. I know that's been an issue with others.

    You would disable the zoom feature. Then in a separate component you create read the mouse wheel to get the delta value. With that, you can access the CameraController component, use GetMotor(xxx) to get the motor, and then change the 'Distance' property however you want.

    In the User's Guide, I provide an example of getting the motor; check out page 28.

    I hope that helps.
     
    Crossway likes this.
  14. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Hey Tryz,

    developing the recoil for your CC is giving me a hard time. I've checked your suggestions, but they doesn't seem to work well. Using SetTargetYawPitch *could* work, but the problem is that user input gets ignored while the recoil is active.

    Wouldn't it be possible to add a method which allows to directly modify the yaw/pitch of the CC?
     
  15. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Hey @silentneedle ,

    SetTargetYawPitch() with a 0 will happen instantly. So, that's a direct modification of the yaw/pitch.

    Here's the code I use in my Shooter Motion Pack to cause recoil with the CC:

    Code (CSharp):
    1.             float lRecoil = GetFinalRecoil(mFireCount);
    2.  
    3.             float lYaw = RecoilYaw * lRecoil;
    4.             float lPitch = RecoilPitch * lRecoil;
    5.  
    6.             if (rCameraRig != null && rCameraRig.Anchor != null)
    7.             {
    8.                 Quaternion lLocalRotation = Quaternion.Inverse(rCameraRig.Anchor.rotation) * rCameraRig.Transform.rotation;
    9.  
    10.                 float lLocalYaw = lLocalRotation.eulerAngles.y;
    11.                 if (lLocalYaw > 180f) { lLocalYaw = lLocalYaw - 360f; }
    12.                 else if (lLocalYaw < -180f) { lLocalYaw = lLocalYaw + 360f; }
    13.  
    14.                 float lLocalPitch = lLocalRotation.eulerAngles.x;
    15.                 if (lLocalPitch > 180f) { lLocalPitch = lLocalPitch - 360f; }
    16.                 else if (lLocalPitch < -180f) { lLocalPitch = lLocalPitch + 360f; }
    17.  
    18.                 rCameraRig.SetTargetYawPitch(lLocalYaw + lYaw, lLocalPitch + lPitch, 720f, true);
    19.             }

    In the above code I use 720f for the speed which makes it pretty fast. Then, the player has to pull the view back.

    That approach should work for you too.
     
    Willbkool_FPCS likes this.
  16. nnoom1986

    nnoom1986

    Joined:
    Jan 9, 2018
    Posts:
    1
    Hello, great asset, so far.

    Recently though, I started utilizing the Curved World asset, and they don't seem to be playing nice together. If the world is curved in a direction, the player will simply walk along that curve, and right off camera, instead of the camera "curving" around the world with him.

    Have you tried these plugins together? Any ideas on how to get around that?

    Thanks!!
     
  17. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    I don't own the asset, but there's nothing in the Camera Controller that would "glue" the camera to the world. It's not a character controller.

    You would put that movement logic on your character controller. Then, the Camera Controller would follow your character controller (that's what I call an anchor).

    As your character controller goes upside down to follow the terrain and move however you want it, the Camera Controller would follow.

    I hope that helps.
     
  18. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    27
    Hello,

    Is there some way how to move whole camera when zooming instead of using FOV?
    It leads to some problems, like sound volume in audio source remains the same or that Skybox gets pixelated as zooming in zooms it too.
     
  19. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Not out of the box.

    You can add that feature a couple of ways...

    You could disable the CC and move the camera how you want.

    You could keep the CC active and move the local position of the 'main camera' that is in the Camera Rig.

    Another option is to create a custom camera motor that does this.

    In all cases you will have to handle the case when an object moves between the original camera position and the zoom position.
     
  20. Michal_Stangel

    Michal_Stangel

    Joined:
    Apr 17, 2017
    Posts:
    27
    Guys, did somebody try to implement moving whole camera when zooming, instead of using FOV?

    Tryz unfortunately doesn't further develop this asset and it seems too complicated task for me from what I've seen in scripts.

    Using FOV brings some problems, like zooming Skybox or not adjusting volume level on audio source based on distance (Spatial Blend). However this one could be simulated in code, with some effort to no to use Play on Awake option in some assets and play it through code instead.

    Other then that, I'm satisfied with this asset and before moving to another one I would like to know if somebody solved it by himself.
     
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    As I mentioned, my focus (for the time being) is on support and not requested features.

    If you want to add this feature, the best approach would be to move the 'Main Camera' that the Camera Controller is the parent of. If you move the local position.z value, it will push the view forward. The tricky part will be when something moves between the camera's original position and the zoom position. You'll need to detect that collision and adjust.

    If you're not able to do that, you might be able to find some to help.
     
  22. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Unfortunately that still locks the mouse input when the recoil is active. Is there any work around?
     
  23. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Controlling the camera rig with SetTargetYawPitch() doesn't lock the mouse input, but it does control the camera rig. If your character's rotation is based on the camera rig, it will be effected as would be expected.

    If you want to create a jiggle or something without it effecting your camera rig, then take control of the "Main Camera" that the camera rig is a parent of; this is how I do camera shake. Just remember to put the Main Camera back to local coordinates of 0, 0, 0 and rotation of 0, 0, 0.
     
  24. Robotron18

    Robotron18

    Joined:
    Aug 15, 2010
    Posts:
    12
    Hello friend. We bought this asset. How would you recommend using it for a mobile application? I mean the integration of CrossPlatformInput, for example. Complete the staff or make own?
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Hi. You would need to create an Input Source that wraps the CrossPlatformInput.

    Check out www.ootiigames.com and search for 'Input Source'. I have details and a video for using my assets with custom input solutions.
     
  26. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Alright, I'll try it with the second approach.

    Another question. Is there any guide how to use the base camera anchor component? I've added it to the camera rig and linked my character, but it doesn't seem to do anything. What I'm trying to achieve is to smooth the camera follow a little bit.

    edit: got it now, you need to create an empty GO which is not a child of the character, on that GO you need to add the base camera anchor which is linked in the camera controller.

    It seems there is sometimes a stuttering when using the base camera anchor with a movement lerp below 1, any idea why?

    edit2: found the issue, the base camera anchor runs in LateUpdate(). Could you please update that component to check the camera controller update loop execution (if fixed update or not) and run its loop in the same & after the camera controller execution?
     
    Last edited: Mar 26, 2019
  27. Robotron18

    Robotron18

    Joined:
    Aug 15, 2010
    Posts:
    12
    Well, I had a few problems while asset's setting up.

    First, 3rd Person Fixed mode has not setting distance from the target by Y. The old SmoothFolow script had the exact settings. How can I precisely adjust the height of the camera lift over the character?

    Then, my 3rd Person Fixed camera from mode goes to 1st Person View mode and back. Reverse movement should return the camera exactly behind character, although 1st Person View mode the camera changes orientation to the character. While there is a problem with returning to the 1st Person View mode.

    And last, the problem with the initial loading of the scene in the Editor. Вistance is not always correctly set In the Editor. Often the distance is zero, then normal.. On the device, everything is fine. Apparently, we need recommendations for the initial installation of objects in the scene. It can place a locator behind the character, according to the coordinates of which the camera object will be installed.

    Thans for support.
     
  28. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Hey @Robotron18 . That motor doesn't work that way. There's a "Distance" property that sets the distance from the anchor. In the User's Guide on page 20, I show that you can use the "Pitch" range to force the lift over the character, but it's an angle.

    I don't understand what you mean. The motors transition based on how you setup the Transition Motors and which Transition Motor you activate. Please check the documentation as it will explain how to use the Transition Motors. A good example is the targeting example I give on page 23.

    The Distance property is a run-time property. The Camera Controller code doesn't "run" in the editor. So, the distance you set will only matter at run-time.
     
  29. mdotstrange

    mdotstrange

    Joined:
    Sep 23, 2013
    Posts:
    211
    Hey Tim- have been using this asset for years on various projects and still loving it ^ ^

    I'm using version 3.30 in my current project- if this has been fixed in a new version I'll update it-

    The CameraMotor.cs is causing some pretty big 40ms GC spikes- seems to be in the AnchorRoot method that is on line 181 on my version-

    Screenshots-



    It causes a pretty big fps drop- just wondering if this is fixed a new version? Thanks

    Update: It looks like that AnchorRoot call is used for the Transform to ignore for the Collision casts- My player is on an entirely different layer so I don't need the ignore- I just passed a null instead of the AnchorRoot so its not called anymore- so there's no more GC- problem solved. Thanks again for the awesome tool!
     
    Last edited: May 8, 2019
    Tryz likes this.
  30. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Hey @mdotstrange ,

    The garbage actually comes from Unity's GetComponent() function while running in the editor.

    I can't find the post, but a while back when I was doing research I found that it only occurred in the editor and not in an actual build. You're fine to pass the null, but you wouldn't see an issue in an actual build even if you didn't.
     
    mdotstrange and TeagansDad like this.
  31. mdotstrange

    mdotstrange

    Joined:
    Sep 23, 2013
    Posts:
    211
    Ok cool- thanks Tim! I've seen that happen with additive level loading as well- huge spike in the editor but not in builds- good to know- thank you!
     
    Tryz likes this.
  32. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    28
    Hello,

    I purchased the Camera Controller asset, read the PDF and tried the MOBA demo scene, as this is exactly what I need. With the default settings in the demo scene, panning does not work properly when the mouse is moved to the left screen border - it is waaaaaay to slow. Panning works fine on all other screen borders though.
    I used Unity 2019.1.4f1 and a new, blank project.

    Am I doing something wrong?
     
  33. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    @fisherman_b - I just tested out the MOBA demo scene on Unity 2019.1.1f1 and panning worked normally for me (the same speed on all four borders). I think I have 2019.1.4f1 installed at home and I'll see if I can have a look at it tomorrow.

    Does panning left work fine if you're using the WASD keys?
     
  34. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    28
    @TeagansDad , thank you for your reply, and sorry for my late reply, there was a holiday here.
    Yes, panning using the WASD keys works fine.

    EDIT:

    My tests so far happened in the Unity editor. I just created a Windows build - it works inside the game.
    Could this be a Unity issue with my dual monitor setup?
     
  35. fisherman_b

    fisherman_b

    Joined:
    Dec 18, 2014
    Posts:
    28
    Yeah, it must be related to screen layouts in the editor. When I use the Unity default layout, the camera panning works. But when I switch to my own default layout, the camera does not pan correctly to the left when using the mouse. I have a fullscreen window on the left main monitor with scene, game and asset store tab, and the editor tabs are separated on the second monitor (hierarchy, project, inspector...)

    Edit: To cut a long story short :)
    The camera pan using the mouse does not work properly in the Unity editor in play mode when I use a custom screen layout using "Maximize on Play" or with the game window in full screen mode
     
    Last edited: Jun 8, 2019
  36. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    @fisherman_b Interesting. I wonder if it's more an issue with how Unity handles mouse input when moving into and out of the Game window when running in the Editor.

    What does your custom layout look like? I'm wondering if you can replicate the issue when panning right instead of left if using a different layout or switching which monitor you've got the Game window in.
     
  37. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    I've tried in Unity 2018 and Unity 2019 and I'm not seeing an issue. In both versions, I did the following:

    1. Opened my demo_MOBA_Style scene
    2. Pressed the "Maximize On Play" option
    3. Ensured the "Top Down" motor only had "Edge Pan" option enabled
    4. Hit 'Play'.

    I was able to pan in all 4 directions with no issues.

    It's possible. The WorldMotor.cs camera motor uses Unity's Screen.width, Screen.height, and Input.mousePosition. I don't have dual monitors to test with. It's possible that the Screen.width is coming back with a sum of your two screens.

    That could be why it works in the build... there's only one screen in Unity's calculations.
     
  38. DropNodes

    DropNodes

    Joined:
    Jun 11, 2019
    Posts:
    21
    Hey,

    My player is instantiated in the game so it doesn't exist in the hierarchy and I can't drag it to the anchor, is there any way for the camera to pick the player in runtime?
     
  39. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    In the CameraController's Start() method, it tries to find a GameObject with the "Player" tag and if found, assigns it to the Anchor property. But if your player is instantiated, then it may not exist yet at the point (or maybe you're not using the "Player" tag).

    If you're using Camera Controller on its own, then you'll need to get a reference to the player and assign it to the Anchor property in another script. If you're using Motion Controller, then that component has an option to find a Camera Rig in the scene.

    So you'd need a simple component on your player prefab that looks for the Camera Controller in its Start() method:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using com.ootii.Cameras;
    4.  
    5. public class CameraInitializer : MonoBehaviour
    6. {
    7.     private CameraController mCameraController;
    8.  
    9.     private void Start()
    10.     {
    11.         mCameraController = GameObject.FindObjectOfType<CameraController>();
    12.         if (mCameraController != null)
    13.         {
    14.             mCameraController.Anchor = transform;
    15.         }
    16.     }
    17. }
    18.  
    19.  
    This assumes that the camera isn't instantiated as well. ;)
     
    Tryz likes this.
  40. TillmaniaLtd

    TillmaniaLtd

    Joined:
    Jan 29, 2013
    Posts:
    44
    Does this work on mobile devices?
     
  41. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Yes. However, you need a custom input source that tells the CC how you read your input and what that should do... Tap, swipe, etc.

    Check out http://www.ootiigames.com and search for Input Source to learn more.
     
  42. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    274
    Are the demos included with the Camera Controller asset broken? Most don't seem to do what the screen says they will with regards to the mouse buttons.

    In demo_1st_Person_Style it says that left mouse button rotates the camera and right mouse button rotates the camera and the character but the character just always rotates for me.

    In demo_3rd_Person_Style/demo_Splines it says the left mouse button orbits and the right mouse button rotates the camera and the character but the right mouse button seems to just orbit.

    The keyboard input on the demo_MOBA_Style is broken and doesn't work at all.

    I'm using 2017.4.22f1(sorry, I know it's a bit stale but Unity kept breaking things in Android in their 2017 releases so I haven't updated lately). I'd like to prototype something for my long holiday weekend so I'm just checking to make sure this isn't indicative of something deeper that's broken(or if I need to use 2018/2019).
     
  43. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    @Obsurveyor - the custom input entries may not be set up. Create a new scene, add a CameraController component to the camera object, then click one of the quick setup options in the inspector (3rd person, etc -- doesn't matter which). This should set all the required input aliases used by all of the demos.

    I think the demo scenes should work after you do this.

    The asset does need an editor tool to update the input settings after importing -- that's on my to-do list. :)
     
  44. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    274
    @TeagansDad Thanks, that seemed to fix all the demos except the 1st Person demo. Left and right mouse button still seem to do the same thing(rotate camera and character). I tried clicking the 1st Person Style for the demo just in case but it didn't change.
     
  45. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    780
    Check the View Rotation setting on the Unity Input Source in the scene. It usually defaults to right button, so set it to none for first person.
     
  46. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    274
    There's a "View Activator" that's set to Left or Right, which seems to explain why both buttons do the same thing but setting it to None makes it so mouse movement moves the view and neither left nor right do anything. Setting it to Left makes only left button work. I can dig into the controller and figure it out. I'm not going to use the Unity Input Source myself anyway.

    Also, any idea why checking/uncheck "Invert" under Pitch under 1st Person View doesn't actually invert anything? Moving the mouse up still tilts the view up regardless of whether it's checked. Maybe not accounted for in the default Unity Input Source?

    edit: Ahh, strangely there's another "Invert Pitch" under the Camera Controller settings, but it doesn't work if the "Invert" under 1st Person View Pitch is checked. edit the edit: Actually, I think they're just fighting with each other over which should invert. Only one of them should be checked to get understandable results.
     
  47. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    215
    Hey @Tryz i have an odd issue with the camera controller i hope you can help me with.

    When i use the target function and the camera shifts to 3rd person follow and i get to close to the target i am attacking the camera moves into something that looks like a top down:

    upload_2019-7-10_12-49-26.png

    These are my settings:

    upload_2019-7-10_12-49-49.png

    Do you know how I am able to change this behavior? I would like the camera to stay behind the character and follow the target.
     
  48. sacunha

    sacunha

    Joined:
    Apr 21, 2016
    Posts:
    138
    Can this camera behave like Unity Editor camera? I'd also like to control zoom speeds (and speed rate, meaning the further away it is from the target, the more it zooms out), zoom panning and look at. Any of source code is available?
     
  49. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Unfortunately, it won't zoom like that.

    All the code is available in the CC. So, you could modify the zoom to move how you want.
     
  50. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,224
    Hey @Censureret , I'm trying to duplicate this, but not having much luck.

    What function are you calling to set the target? Are you transitioning to this Camera Motor or just forcing the camera direction?