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

Camera Controller Release

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

  1. retropercolator

    retropercolator

    Joined:
    Aug 3, 2018
    Posts:
    1
    omg thank you! i spent two weeks trying to find the fix for this
     
    Rewaken and Tryz like this.
  2. PolarU

    PolarU

    Joined:
    Mar 14, 2017
    Posts:
    3
    I am using a Top-Down View Motor. I created a really simple script to rotate the camera 90 degrees on key press (Q and E). It accomplishes this with a Quaternion.Slerp() on the camera rig's transform.rotation. Here is the code for that in case it is relevant.

    I've noticed that when "Use View Direction" is set to true in the Top-Down View Motor I get this really bad jitter in the game view. In the scene view everything is smooth, so i'm confident it is related to the camera. When I set "Use View Direction" to false the jitter goes away, but I prefer to have it on so that the camera rig will move when my character is pressed up against walls and otherwise invisible.

    Here is a gif demonstrating the jitter, and showing my Hierarchy.
    https://gyazo.com/aab6ba9e887d5ec3451475717f062b05

    My best guess is that my rotation handling script is at odds with the motor and the two are trying to set rotation/transform values over each other. But I'm not sure. Has anyone else experienced this? What can I do?

    If there is any more context or information I can give please let me know.



    Edit: I'm not sure if this is really the _best_ fix so if someone out there can help me out please let me know! But, the jitter is gone after I moved the cameraRigTransform.rotation = Slerp() to Update() instead of LateUpdate(). I read somewhere that camera movements should be handled in LateUpdate, but I'm not actually change the camera transform directly, I am updating the camera rig's transform. Seems smooth in Update(). Here is a new gist of my CameraRotationController https://gist.github.com/PolarKC/21db87e5da083957ba18088e601d7285
     
    Last edited: Feb 25, 2021
  3. benkpomeroy

    benkpomeroy

    Joined:
    Jan 31, 2021
    Posts:
    1
    I think I made a mistake purchasing this. I am extremely new to Unity and I just want to be able to switch from 1st person to top down to isometric view easily. I thought I could do that with this but the MOBA layout is not what I thought it was. I need to be able to zoom in and rotate, but I can't make any sense of this.
     
  4. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    842
    You can make any camera type you want with this....but I would take the TIME to learn Unity, before buying anything again.... This way you understand things better.. Be sure for this asset to watch videos, and read docs, but more importantly you need to understand how cameras work... You can even add functions to this camera, or any camera for that matter..
     
    fairtree likes this.
  5. namdo

    namdo

    Joined:
    Feb 23, 2015
    Posts:
    200
    Can i rotate the camera without clicking the right mouse button down.
     
  6. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    Yes. On the Unity Input Source component, change the View Activation property to "None."
     
  7. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Why there is no option to set anchor Y offset for each camera separately? On camera follow I need to set Y offset to 1 but on targeting I need to change Y offset to 1.7!

    For X axis we can use "X-Axis Offset" separately for each camera. But can't find same for Y axis.
     
  8. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    Right. This worked fine for me in 2018, 2019... but when I try it on 2021.2, it's gives me errors complaining about AnimationControllers and com.ootii.Actors.

    ```Assets\ootii\Assets\CameraController\Code\Cameras\CameraMotors\TransitionMotor.cs(423,138): error CS0234: The type or namespace name 'AnimationControllers' does not exist in the namespace 'com.ootii.Actors' (are you missing an assembly reference?)```

    I updated it to the latest version.
     
  9. uonlyliveonce

    uonlyliveonce

    Joined:
    Nov 6, 2018
    Posts:
    41
    I asked a question on the ootii forums - can you look at it when you have the chance (it's been a few days).
     
  10. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    With the camera controller , how would follow a player while the player walks towards the camera?

    Is it possible to configure with the Basic Camera Anchor or the Camera Controller components ?
     
  11. MaximilianPs

    MaximilianPs

    Joined:
    Nov 7, 2011
    Posts:
    321
    I can't find the Inventory Pro Integration as it been removed? :(
     
  12. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I bet nobody's getting notification of your posts. It's best to ping the thread owner - @Tryz - that way they'll get a notification. And if that doesn't work, email the support address associated with the asset.
     
    Crossway likes this.
  13. jf3000

    jf3000

    Joined:
    Dec 31, 2013
    Posts:
    166
    This asset is extremely buggy, just doesn't work out of the box.
     
  14. KeithBrown

    KeithBrown

    Joined:
    Apr 1, 2017
    Posts:
    191
    Maybe you can be more specific? This asset has been working pretty great for a lot of people for a long time. What version of unity are you using?
     
    Crossway likes this.
  15. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    Forget that, the asset works fine, i use it all the time and have no Bugs with it.
     
  16. Rujash

    Rujash

    Joined:
    Jan 3, 2014
    Posts:
    37
    This problem was actually the main reason I was scouting out this asset, myself. There needs to be an option where if the player/target is a certain amount near the camera (or object camera is colliding with) then collision is disabled on the camera, or it avoids the player/runs away by forcing itself upward and away/wherever is closest to run to. One solution would even be to force 1st person view.
     
  17. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Hello,

    I want to use the 3rd person camera style, however I want it to constantly remain behind the player (Currently it only remains behind the player if right mouse is clicked to rotate with the player) with the option to toggle on/off pitch/yaw.

    It would help to be able to have a start / default Pitch / Yaw for the Camera, so that when the player toggles off pitch/yaw it reverts back to default

    How do I achieve that?

    Also, the zoom in and out from playing around with it seems to only work by zooming in but not out?
     
  18. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    957
    @zKici You can set it to remain behind the player by setting the View Activator field on the Unity Input Source component to "none":

    upload_2021-11-18_13-13-7.png


    You'll probably need to write a short script to toggle the pitch/yaw on the desired camera motor in response to whatever player action should toggle it. The values that you enter into the inspector will be the default values, but you may have to store those in your custom component when it initializes.

    Zoom works when I try it with these settings:

    upload_2021-11-18_13-21-19.png

    Double-check that you have the Camera Zoom input alias set up correctly in the Input Manager:

    upload_2021-11-18_13-22-3.png
     
  19. jeroll3d

    jeroll3d

    Joined:
    Nov 6, 2010
    Posts:
    249
    One of the best assets on store. just love it.
     
    Tryz likes this.
  20. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    I use this asset with new input system but there is still a big problem with parsec or remote desktop apps! when mouse reaches to the borders of parsec windows it stops working so I can't rotate my character or camera completely in 360 degree :eek:
     
  21. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    The CC will just take input from your input source (i.e. Unity's New Input System) as it gets it. If I were to guess, the remote app itself isn't sending commands when you're outside the desktop or active window (i.e. at the border).

    I'd confirm you're actually getting input transferred when you're at the border of the parsec window.
     
  22. YsoSiris

    YsoSiris

    Joined:
    Jan 7, 2022
    Posts:
    16
    Hey there @Tryz and Forum, quick question, I'm kinda a novice and i'm still learning some things in unity, please bear with me. I bought the Ootii product in the Unity Store, and It uploaded well and looks very good, my only question is, I'm attempting to use my Playstation 4 Controller for my game more so than the mouse handling aspects, when my character and camera moves around in the scene, he and camera is not moving forward if I push the joystick up or if I push the joystick to the left he goes opposite to the right, or if I push the joystick down he goes upwards etc.....
    I desire for him to move in 3rd person follow type view, which I have set up from Tutorials and when I move the Joystick upwards they should move forward straight ahead and if I move the Joystick to the left it should turn left, yet everything seems to do the opposite and going backwards....

    Please help me out, anyone, this is a good CC and I want to get active, yet need to hurdle or grasp a better overstanding of the proper functions....

    Thanks to all.....I'm glad I found this forum, been trying to figure it out alone.
     
    Last edited: Aug 2, 2022
  23. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    When I enable "Use Fixed Update" camera shakes really bad when following the character. Is there any way to fix this issue?
     
  24. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @YsoSiris ,

    There's a couple of layers here.

    There's a bunch of different assets that can be used to take input and use the PS4 controller (Rewired, In Control, Unity's old Input System, Unity's new Input System, etc.). So, I built my assets to use any input system. I call this an "Input Source". Basically, we can create a custom Input Source to wrap any input solution you want to use.

    You can read more about it and see a video here: Input Sources

    Unity's newer Input System is a pretty good built in solution. This is now a standard part of Unity. With it, you can customized the input to read the PS4 controller. In my assets, I include a "Unity Input System Source" that you can use with Unity's Input System. You can learn more about here : Unity Input System Source

    I hope that helps.
     
  25. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @Crossway ,

    Camera systems like the Camera Controller typically have a pretty tight coupling with the Character Controller. So, the player moves, the camera follows the player, the camera renders the scene from it's new position, etc.

    You can get a bunch of shake if the systems aren't coupled. Lets say you're updating your player position in Update and the camera updates in FixedUpdate. This means you're rendering from an old position because the camera "follows the player" to its old position during FixedUpdate. You get a ton of jitter.

    So, make sure your player and camera are coupled.

    There's some under-the-hood code that the Camera Controller has available to manually sync with the Character Controller. For example, you can call the Camera Controller's Update function in code to ensure it always happens after the player moves. If you need that info, let me know.

    I hope that helps,
    Tim
     
  26. Gervais60

    Gervais60

    Joined:
    Apr 7, 2016
    Posts:
    37
    Hi

    i am using the OOTII motion controller and camera controller work fine with all I am doing except on situation where the player step on a moving platform that can go any direction the player has no problem to stay on the moving platform after attaching them.

    But the camera start to move backward and try to follow the player, is there a way to also attach the camera to the moving object I try to parent all the transform of the camera to the moving platform but nothing work properly

    Do you have any suggestion on how to fix this

    Thanks
     
    Last edited: Sep 23, 2022
  27. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @Gervais54 With the Motion Controller and Camera Controller, you don't want to make them children of the platform. That happens automatically in a different way. If you do, you'll get double rotations.

    On the Camera Controller, you set the "Anchor" as the character. So, the Camera Controller will follow the player as they move and rotate on the platform automatically.

    In the picture below, the platform moves up and down and rotates. The character and camera move and rotate with it even though they are not children of the "Cube" object (that's the platform). I'm using the Camera Controller's "Third Person Fixed" motor in this example.

    upload_2022-9-24_8-40-48.png

    All your character had to do was walk on the platform and the movement and rotation happens as if they are parented.

    I hope that helps,
    Tim
     
  28. Gervais60

    Gervais60

    Joined:
    Apr 7, 2016
    Posts:
    37
    I am using the "3rd Person Follow" motor in my program
     
  29. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    773
    This is probably going to be a long shot, but does anyone else here use the Volumetric Fog & Mist camera effect from Kronnect? I'm having a weird issue where my camera drifts away from the camera rig over time, and stops pointing at my player. It only seems to happen when the VF&M effect is active on the camera, and usually only after I use zoom, or my player enters a confined space, or I do a lot of camera movements while also moving the player. This makes no sense, since a lens effect should have zero influence over the camera's position and rotation transforms. Here's what it looks like though.



    I've asked on the Kronnect forum, and the author confirms his script shouldn't effect camera position or rotation, and has no obvious mechanism for doing so. Can anyone else think of a possible Rube Goldberg interaction between these 2 scripts that might account for this?

    Edit: I've fixed it by adding a script that pins the camera transform to the camera rig transform in fixed update. This has never been needed before, and I'm not sure why it's needed now, but the camera definitely wants to wander off when using Volumetric Fog & Mist, so it looks like it needs a leash now. :rolleyes:
     
    Last edited: Oct 17, 2022
  30. SoloHonk75

    SoloHonk75

    Joined:
    Mar 27, 2016
    Posts:
    31
    Unfortunately the component is not displayed correctly in unity 2022.2. Is there a workaround or will this be fixed soon?
     

    Attached Files:

  31. Tryz

    Tryz

    Joined:
    Apr 22, 2013
    Posts:
    3,402
    Hi @SoloHonk75 ,

    It looks like Unity's new UI system in 2022.2 changed a couple of things. Here's a quick fix:

    1. Open EditorHelper.cs (in an Visual Studio or any simple text editor)
    2. On the following lines:1341, 1368, 1395
    3. Change the lines

    From this:
    Code (CSharp):
    1. Font lFont = (Font)Resources.GetBuiltinResource(typeof(Font), "Arial.ttf");
    To this:
    Code (CSharp):
    1. Font lFont = null;
    One other thing I found:

    1. Open InputManagerHelper.cs
    2. Replace lines 99 and 100
    3. With this:
    Code (CSharp):
    1. bool lIsNext = lAxis.Next(true);
    2. if (lIsNext && lAxis.stringValue == rName) return true;
    I'll do some more testing and get an update up. Probably in the next couple of days.
     
  32. SoloHonk75

    SoloHonk75

    Joined:
    Mar 27, 2016
    Posts:
    31
    Tested and looks good so far. I own and use your other extensions too. Since a similar layout is used there, it is likely that errors could also appear there. But first of all thanks for the quick help.
     
    Tryz likes this.
  33. YsoSiris

    YsoSiris

    Joined:
    Jan 7, 2022
    Posts:
    16
    Peace to All, I have been using ootii CC for a lil bit now, I got my crouching and prone views working good with the Y Anchor in CC dropping to the same level as the player when in those modes....I now need a little more assistance with the Gun Aiming Targeting In and Out methods, i have been trying for a while (Months), yet my outcome is still not to clean of a switch between the zoom aim and normal, i am actually bummed out a lil bit, meaning i personally can't make it right enough to be official, and i need some greater minds to assist me please, hope this post is not to old to reply too, its the only link i had to get back to you all who helped me prior...I usually try my best to learn through due dillignece, yet I'm at my crossroads with no water.....

    Thanks