Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

3rd Person Camera - emulating the World of Warcraft camera with Smart Pivot and Thickness Checks

Discussion in 'Assets and Asset Store' started by Enzi, Feb 3, 2016.

  1. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Version 1.0.5.5 is now available here and has the following changes:
    - added a stabilization for follow/lock on rotations to prevent wrong rotations in Z-axis
    - added mouse/keyboard/gamepad input to LockOnTarget for locking on target and switching to next/previous
    - improved lock on target mode with weighted distance and angle
    - added input properties for aiming and switching sides to OverTheShoulder
    - added "forwardFromTarget" to LockOnTarget which provides a more stable sampling of targets when cycling through targets is preferred
    the default mode takes the forward from camera - which gives the best results when cycling isn't needed and the target that is looked at is more important

    When everything is working out the update will be pushed to live in a few days.
     
    Shiro_Rin likes this.
  2. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    How do I enter my Invoice Number for the Beta? I copy and pasted my invoice ID and it says access denied.
     
  3. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Can you try with your invoice or order number? The order number is only visible in the subject. Both should work I think and are numeric values.
    If it doesn't work, please send me an email with the numbers so I can check if something on my backend is going wrong and so I can send you the package.
     
  4. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    I never though to use the Order Number, so that's my bad. It works just fine, I was using the Invoice ID they send in the PDF file attached to the email.
     
  5. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hello Enzi, I'm currently using a rpg framework asset that has it's own camera system. The camera system it uses does not have very good collision detection or options like a follow cam, and it is required to be used by the framework. Can I integrate components of your camera asset with those of required camera system of the framework to add functionality such as better collision detection or follow cam?
     
  6. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Hello!
    While I can only make assumptions about the framework, I'm pretty confident you can integrate the 3rd person camera without much issues. Either you set the target directly in the camera controller when the player character already exists in the scene or there will be a point where the player character will spawn and there you'd need to call the InitTarget(transform) method of the camera controller.
     
  7. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    It might work out with the first method you mentioned, I'll give it a try and see if I can integrate it that way with the required camera system. Thanks for the reply!
     
  8. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hi, I imported the asset into my project and tried the first method you mentioned in your post. I put a Camera Controller component on to the camera prefab and set the Target as a child object of the camera prefab. It worked, but it naturally only orbits/zooms to the camera prefab Target position, not orbiting/zooming to and around the Player.

    I then set the Target as the Player prefab (the Player game object is not initially present in scenes and is spawned into scenes). This resulted in the camera prefab being set in it's initial position int the scene and not positioning itself behind the Player and following/orbiting (just a static camera view from the camera prefab in the scene).

    So it seems the first method won't work. Regarding the second method you mentioned, could you give me a simple script example of how to call the InitTarget(transform) of the Camera Controller? I do apologize, I'm not good with scripting and want to make sure everything is correct in the script so I can eliminate this as a problem if it doesn't work.
     
  9. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Hey! Sure thing!

    So the simplest way to do this is to find the point where the player character is instantiated which looks something like:
    Code (CSharp):
    1. GameObject player = Instantiate(playerPrefab);
    and then you can call:
    Code (CSharp):
    1. Camera.main.GetComponent<CameraController>().InitFromTarget(player.transform);
     
  10. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    I looked at the script used to spawn the Player in scenes (SpawnPlayerC) and here's the code:

    //Spawn Player
    GameObject spawnPlayer = Instantiate(player, transform.position , transform.rotation) as GameObject;
    mainCam = GameObject.FindWithTag ("MainCamera").transform;
    ARPGcameraC checkCam = mainCam.GetComponent<ARPGcameraC>();
    //Check for Main Camera
    if(mainCam && checkCam){
    mainCam.GetComponent<ARPGcameraC>().target = spawnPlayer.transform;
    }

    PlayerPrefs.SetFloat("PlayerX", spawnPlayer.transform.position.x);
    PlayerPrefs.SetFloat("PlayerY", spawnPlayer.transform.position.y);
    PlayerPrefs.SetFloat("PlayerZ", spawnPlayer.transform.position.z);

    //Screen.lockCursor = true;
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = false;


    So I should add the script after this line:

    GameObject spawnPlayer = Instantiate(player, transform.position , transform.rotation) as GameObject;

    Is this correct? Also, do I need to add the Camera Controller component to the main camera prefab for this to work properly?
     
  11. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Try to replace these 2 lines:
    Code (CSharp):
    1. ARPGcameraC checkCam = mainCam.GetComponent<ARPGcameraC>();
    to
    Code (CSharp):
    1. CameraController checkCam = mainCam.GetComponent<CameraController>();
    and

    Code (CSharp):
    1. mainCam.GetComponent<ARPGcameraC>().target = spawnPlayer.transform;
    to
    Code (CSharp):
    1. checkCam.GetComponent<CameraController>().InitFromTarget(spawnPlayer.transform);
    Yes! You need a Camera Controller and a FreeForm component on your main camera.
     
    Last edited: Aug 12, 2020
  12. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Will I need the Camera Controller component on my prefab main camera (with the Target field empty) for this script to work?
     
  13. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Yes, CameraController and FreeForm precisely. (FreeForm is for handling the orbital movement) The target can be left empty because it's set later at runtime. All other settings, including layer settings should be set on the prefab.
     
  14. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    1.0.5.5 and 1.0.5.6 will be out soon in the asset store!
    1.0.5.6 focused on UX of components with added header and tooltips which looks much cleaner now in the inspector and doesn't need you to look up every single field, what it does, in the documentation.

    1.0.5.6
    • added headers and tooltips to components and fields to provide easier documentation
    • changed smoothTargetValue in CameraController from float to Vector3 to have more control over axis
    1.0.5.5
    • added a stabilization for follow/lock on rotations to prevent wrong rotations in Z-axis
    • added mouse/keyboard/gamepad input to LockOnTarget for locking on target and switching to next/previous
    • improved lock on target mode with weighted distance and angle
    • added input properties for aiming and switching sides to OverTheShoulder
    • added "forwardFromTarget" to LockOnTarget which provides a more stable sampling of targets when cycling through targets is preferred. The default mode takes the forward from camera - which gives the best results when cycling isn't needed and the target that is looked at is more important
     
    Last edited: Aug 12, 2020
  15. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hello Enzi, thanks for the recommendations. I did the following to get the camera controller working in my project:

    -Added 'using ThirdPersonCamera;' to the top of my SpawnPlayerC script (below 'using UnityEngine' and 'using System.Collections')
    -Disable the original script and added the script from above to SpawnPlayerC script
    -Disabled the legacy controller component on the main camera
    -Added CameraController and FreeForm components to the main camera

    When I played a scene that spawns the Player using the SpawnPlayerC script, the new camera controller appears to be working properly. The Target field is filled in properly with the Player prefab, and I set the Player Layer to Player, the Camera Mode to Always and enabled Force Character Direction.

    The problems occur with the menu system my framework uses. For example, when I hit the Escape key, a small menu opens (Resume, Save, Load and Quit), the cursor appears, yet when I click the button fields to execute those actions nothing happens, and the cursor disappears. It's the same with the other menus (Quest, Stats, etc.), I can't use the buttons in the menu fields. Have you encountered this, or have any insight as to how to get those menus working properly?
     
  16. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hi Enzi, I spoke with the author of the framework I'm using and now have your asset working properly within it. I'm going to test it out thoroughly but so far the results are very positive. Just wanted to give an update on things, thanks for the help!
     
  17. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hi, had a question about the mousewheel action when Camera Mode is set to Always. Since the mousewheel zooms the camera in and out, would it be possible to add script so that, when the mousewheel button is pressed, the camera controller shifts the camera to a position in front of the Player, looking back at the Player? Almost like a 'reverse' view, where you can see the front of the Player and what is behind the Player.
     
  18. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Great to hear you got it working and thanks for reporting your steps so detailed.

    I usually have a routine that checks when the interface is hovered. That state enables or disables FreeForm from sampling input and locking the cursor.
    If you have UnityUI you can get it very easily with:
    Code (CSharp):
    1. bool InterfaceHovered = EventSystem.current.IsPointerOverGameObject();
    2. if (InterfaceHovered)
    3.   freeForm.cameraEnabled = false;
    4. else
    5.   freeForm.cameraEnabled = true;
    6.  
    Regarding your question about looking back. I'll add it in the next update. If you want to add it yourself put this in FreeForm around line 203:
    Code (CSharp):
    1. if (Input.GetMouseButtonDown(2)) // flip y-axis when pressing middle mouse button
    2. {
    3.   var tmp = transform.rotation.eulerAngles;                  
    4.   transform.rotation = Quaternion.Euler(tmp.x, tmp.y + 180.0f, tmp.z);
    5. }
     
  19. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hi Enzi, I was able to work with the asset creator to work out the menu problems and he really helped sort things out (it was a matter of freezing things at the proper place in his script).

    I just tried out the 'look back' script, and it does work, but when the 'Force Character Direction' option is enabled, when the mouse button is pressed, the player and camera rotate 180 degrees, with the camera still looking at the back of the player. Would there be a way to do the following:

    -Hold mouse button
    -The camera take the 180 degree position, looking at the player's front while being able to rotate
    -Release mouse button and camera goes back to normal position behind player

    Thanks for all the help with this!
     
  20. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Right, that was working a little wonky. I've rewritten it so the middle mouse button has to be held. (It's in version 1.0.5.7)
    This is as far as I can go with it, the rest is up to you and the character controller to get the directional movement right when looking backwards.
    Disclaimer: I can't give any support for the used character movement in the asset as it's now an obsolete unity standard asset and very limited when it comes to movement. I have plans to solve this issue but that's further into the future.
     
  21. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    1.0.5.7 is available as beta with the following changes:
    • fixed occurances where automatic zooming out failed and the camera would reposition itself too fast
    • improved smart pivot transition
    • improved camera offset clipping
     
  22. JuliusIbidus

    JuliusIbidus

    Joined:
    Jun 3, 2018
    Posts:
    43
    Hi Enzi, I've been able to sort things out and get some really good input action with the camera controller. Thanks for all of your help!
     
    Enzi likes this.
  23. Broudy001

    Broudy001

    Joined:
    Feb 12, 2020
    Posts:
    4
    Hi I recently picked up the asset, and the camera works really well, and with reference to another use on the reviews, I can get the New Input System to work, but then when an update is released I need to redo the changes I've made to get the new input system working. In a future update would breaking out the Input handling to its own class be a possibility so that inherited versions can be made to account for input changes without having to worry about if you release a new update?
     
  24. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Hey Broudy!
    I'll see what I can do about it. Easiest thing would be if you send me your code changes to my email.
     
  25. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    Sorry ahead of time as I'm typing this from my phone at work.

    I've been doing the same thing. It's pretty easy. Essentially anything that involves "keyboard and mouse / Gamepad" button inputs, I delete it and replace it with the New Input System. An example would be

    Code (CSharp):
    1. Private Controls controls; //this is a reference to my input system script
    2.  
    3. Private void Awake(){
    4. controls = new Controls(); //created the input system
    5. }
    6. Private void OnEnable (){
    7. controls.Enable(); //enables it for use
    8. }
    9. Private void OnDisable (){
    10. controls.Disable(); //disables it so we don't get errors
    11. }
    12.  
    13. //Then for anything that used input.GetButtonDown() I can replace with something like
    14. //controls.Player.Zoom.triggered
    15. //Or anything using Vector2 input with something like
    16. //controls.Player.Look.ReadValue<Vector2>();
    It cuts down on the inspector a bit and works great. The only issue is having to make a tutorial on how to customize this as I'm sure some users haven't the slightest clue on how to use the new input system.
     
    Enzi likes this.
  26. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Thanks Shiro!
    So, I propose on making a data struct with inputs for the camera. I'll add a new component that samples the inputs and feed it to the camera by default.
    That way integrating a new input system should be easy for you as you could use a copy of the input sampling or new script with other input methods that wouldn't get overwritten by updates.

    @Shiro_Rin @Broudy001
    If that's okay for you two I can start writing this in the next days.
     
    Shiro_Rin likes this.
  27. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    Sounds awesome!
     
  28. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    1.0.5.8 is available as a beta with the following changes:
    • Input sampling of FreeForm, OverTheShoulder and LockOn has been split into seperate scripts and a data oriented model is now used for main scripts:
    • FreeForm uses struct CameraInputFreeForm
    • LockOnTarget uses struct CameraInputLockOn
    • OverTheShoulder uses struct CameraInputShoulder
    These scripts are updated with the UpdateInput(CameraInput...) method. This method should be used for
    custom input sampling scripts
    • added CameraInputSampling_X components which samples inputs and automatically updates the according input model with UpdateInput(CameraInput...)
    These scripts can be used as a template for custom input sampling or adding additional inputs
    • added component CameraInputSampling_FreeForm
    • added component CameraInputSampling_Shoulder
    • added component CameraInputSampling_LockOn

    Important
    When upgrading from a previous version add the relevant CameraInputSampling script to the game object. The scripts will throw an error when the CameraInputSampling components are not found and CustomInput is not activated.
     
  29. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    1.0.6.0 is available as a beta with the following changes:
    • added TPC_DEBUG to CameraController which enables debugging options for raycasts visualization.Either uncomment TPC_DEBUG in the script directly or define in Unity project settings
    • improved unreliable raycast hit handling on edges and sorting for the best results
    • improved distance handling on repositions
    This version brings a lot more stability and I'm pretty happy with the results. There was a code regression in sorting raycast hits which was unreliable on edges or clipping geometry and led to small jumps in the camera position. Additionaly I introduced a second level of finer raycasts which helps the sorting and in situations where the collision distance is very small. (< 0.1)

    As always, feedback is appreciated and I'll keep the version a few days in testing and then update the asset store version.
     
    Shiro_Rin likes this.
  30. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    Hey! Just got around to downloading the Beta, testing it out now.
    So far, I like the way inputs are handled. I copied the provided script and modified it to my needs, and no issues at all. I did have to look into the actual script to figure out what certain buttons like Middle Mouse Button did in the struct.
    So as far as my inputs are concerned, my input script will work with newer versions out of the box or at the very least minimal changes to accommodate new features?
     
  31. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Great!
    I'll push 1.0.6.0 to live in the next few days.

    Yes, that's the idea.There shouldn't be any breaking changes that would keep your scripts from running correctly.
    I've added more inputs and in an update you can copy those to your script. (if you actually need them)
     
    Shiro_Rin likes this.
  32. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    Hey so I have a question of implementation. I use DOTween for Camera Shakes and noticed that it doesn't work while using the camera system. I'm wondering how I should implement DOTween functions?
     
  33. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Can you try using the offset vector for the shake?
     
    Shiro_Rin likes this.
  34. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    That was exactly it. I completely forgot I can use Shake on Vector3's.
     
    Enzi likes this.
  35. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    1.0.6.1 has been submitted to the Asset Store.

    The changes are:
    1.0.6.1
    - added MouseCursorHelper for Windows platform to support cursor locking in place
    and not in the center of the screen
    - added gamepad button sampling to FreeForm input sampling
    - added public bool inputSamplingEnabled to all input sampling scripts
    with which sampling can be disabled (for example when hovering interface elements)
    - added forceDirectionFeature to FreeForm input sampling, which handles
    forcing the direction of FreeForm with mouse buttons (for example, only force direction with right mouse button)
    - added stabilizeRotation to FreeForm in case the z-rotation starts to drift
    1.0.6.0
    - added TPC_DEBUG to CameraController which enables debugging options for raycasts visualization.
    Either uncomment TPC_DEBUG in the script directly or define in Unity project settings
    - improved unreliable raycast hit handling on edges and sorting for the best results
    - improved distance handling on repositions
     
  36. Kadarn88

    Kadarn88

    Joined:
    Jun 28, 2020
    Posts:
    3
    Hi @Enzi i purchased this asset a couple of days ago and it's amazing, however i have a problem i hope you can help me to fix: i really need the camera to rotate on the X axis when in "follow" mode, based on mouse up/down movement. I tried many of the settings in the component but i could'nt make it work. I created a custom script to handle this rotation,

    something like:

    Code (CSharp):
    1. camera.transform.Rotate(mouseAxisY * 3, 0, 0);
    but the rotation gets clamped and almost immediately reset to the default. In my game i have a raycast starting from the camera position that highlights the objects the player can interact with, so i really need to be able to look around using the mouse. I already tried adding the "Free form" camera component, but i need also to have the camera following the player.

    Is there any configuration or hack to gets this behaviour in place? Thanks in advance
     
  37. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Hello Kadarn!

    I've made some adjustments to the FollowCamera demo scene in 1.0.6.3 which you can find here.
    There's a new setting in Follow, called "Ignore XRotation" which ignores the FreeForm camera x-rotation.
    This is early design and I can improve this so every axis can be ignored. For now, please take a look if this is what you were looking for.

    Cheers!
     
  38. Kadarn88

    Kadarn88

    Joined:
    Jun 28, 2020
    Posts:
    3
    hi, sorry for the late reply but i cannot access the 1.0.6.3 version at your link, when i fill in my invoice number i get an "access denied" error, could you please help with this?
     
  39. Shiro_Rin

    Shiro_Rin

    Joined:
    Jun 24, 2014
    Posts:
    321
    It's not the Invoice but the Order Number in the header of the email.
     
    Enzi likes this.
  40. Kadarn88

    Kadarn88

    Joined:
    Jun 28, 2020
    Posts:
    3
    indeed, thanks!!!

    @Enzi using the "ignore x rotation" parameter worked like a charm, thank you very much!
     
    Enzi likes this.
  41. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Thanks for jumping in Shiro!

    Great to hear Kadarn! I'll clean up the beta version and push it to live in the next week.
     
    Shiro_Rin likes this.
  42. Broudy001

    Broudy001

    Joined:
    Feb 12, 2020
    Posts:
    4
    Hi Enzi,

    Thanks for doing the Input extraction, I've finally been able to have a look at it last night, and its working well so far. Hopefully I'll be able to look into it further, but so far its doing what I was hoping to do.
     
  43. Zan_Kievit

    Zan_Kievit

    Joined:
    Mar 24, 2018
    Posts:
    10
    Hello Enzi,

    I've encountered a couple of bugs on version 1.0.6.3 from the asset store I would like to like to report. These bugs also appeared in previous versions, it took me a while to find time to test again since version 1.0.6.0 came out.
    (I have been able to reproduce them in your "DarkSoulsCamera" test scene, having the smart pivot disabled. Everything has been reproduced with both box colliders and convex mesh colliders. The further the desired distance is set the more pronounced all problems occur.)

    One of them is that sometimes the camera goes through collisions whenever the camera is either directly or almost directly under the character. (Going through, as in suddenly completely ignoring the collision and going to the desired distance)

    Another is that whenever the camera is colliding and is moving between colliders that are perfectly aligned, it jumps or snaps a little on the edges of those colliders. The closer the camera is to the character, it becomes more apparent and the jumps and snaps become more pronounced.
    (I turned the wall planes into convex mesh colliders to more easily reproduce this, however, it's still reproducible from the slopes to the floor plane. Which is also the indicator that this bug also occurs with non-convex mesh colliders with transitions from or to slopes.)

    The final bug I encountered is that when colliding with a collider the camera seems to jump between colliding to the collision distance and ignoring that distance straight to the collision. This can be a singular jump, but you can find random spots where this will continually jump back and forth.
    (This bug is a little bit harder to find and takes a little bit of moving around the character and the camera. The easiest way to find it is on a large plane like surface including for example the large box in your scene.)

    I'm currently working on an indoor game with a lot of large straight walls and large parts where the floor and or walls are made up of individual boxes. I think you can imagine how I found these bugs, and how much I need to get rid of them lol
     
  44. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Hey @Zan_Kievit
    Thanks for the detailed report! I'll try to reproduce and fix those issues.
     
    Zan_Kievit likes this.
  45. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    @Zan_Kievit
    I tried reproducing but I'm not very successful in doing so right now. Can you send me an email with more details? (inspector settings, target transform settings, screenshots or videos)

    Thanks for your time.
     
    Zan_Kievit likes this.
  46. Zan_Kievit

    Zan_Kievit

    Joined:
    Mar 24, 2018
    Posts:
    10
    I"ll make some videos to showcase the bugs and email them to you then!
     
  47. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    I've made some very good progress on fixing those issues already.
    The smart pivot routine has been completely eliminated for example and isn't an individual code path any more which fixes most of the problem surrounding the smart pivot.

    Another annoyance with the controller is having only a single rotation to control the camera. I'll split this up in a cameraRotation and pivotRotation. This makes it much easier to implement features that the camera wasn't initially designed for.

    You can expect an update very soon. Hope it'll live up to my words. :)
     
    Zan_Kievit likes this.
  48. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    1.0.6.4 is in testing now. For everyone interested please follow this link.

    While I'm not done polishing this version, this beta already has improvements that I'd like feedback on. (@Zan_Kievit )

    - The main transform.rotation has been split up in new Quaternions for camera rotation, pivot and smart pivot rotations:
    Not only is the smart pivot now smoothly integrated in the rest of the systems, the new pivot opens up another level of control. Rotations without the camera moving/rotating around.
    - Raycast hit sorting has been improved which should solve most jitter issues (Haven't found them while testing)
    - Thickness check improvements, more stable results
    - Smart pivot ground check improvement where it would not trigger smart pivot on slopes. There is now also an option to have smart pivot only on grounds and/or walls
    - Repositioning when colliding has been improved and getting back to the the desired distance should be more stable/smooth
    - A new demo scene: car with lock on
    - Introduced new parameters:

    Camera Controller
    - Smart Pivot only on ground
    - Pivot Rotation Enabled
    - Smooth pivot: pivot will smoothly slerp to new pivot
    - Custom Pivot: enable to use pivot angles for override
    - Pivot Angles
    Free Form
    Stationary Mode Horizontal/Vertical
    Stationary Modes (enum)
    - Free: no limits in angle
    - Fixed: can't move axis
    - Limited: limited in angles
    - Rotate when Limited: limited by angles, when over threshold rotate the camera
    Stationary max angle Horizontal/Vertical
    Follow
    - Disable time: When there is input in freeform, follow will disable and enable after the disable time
    LockOn
    - Disable time: When there is input in freeform, LockOn will disable the "smooth pivot" mode and enable it after the disable time
     
    Broudy001 likes this.
  49. Zan_Kievit

    Zan_Kievit

    Joined:
    Mar 24, 2018
    Posts:
    10
    Hey, it's nice to see how hard you're working on it! I can definitely see some improvements when it comes to the frequency the bugs occur. Especially within your current scene. (No change to the collision ignoring I mentioned.)
    I tested under the same conditions as mentioned in the email.

    They are however still very present, especially with different scene setups. I would advise you to add some more testing sections to your scene.
    For example, by duplicating the large box and putting it next to the other. It already invites another bug to occur, and ups the frequency of the jumping and snapping to happen. It seems to be more frequent on rectangular box colliders as well. I think it would also help to put some walls and platforms made out of standard one by one cubes put next to each other to the scene to get the most out of the bugs.

    The extra bug I found during testing is that the camera will ignore collision in a similar fashion to how it does in the other collision ignoring bug. I found it to happen whenever going over 2 perfectly aligned box colliders, right on the edge where they align.

    (I have made a duplicate of the big box in this picture. It would probably be easier to give them a separate texture to see the edges of the models lol. It also happens in other ways when the character is further away from the middle, where it kind of tucks behind the corner)
    upload_2020-10-12_14-2-26.png
     
  50. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    437
    Hey Zan!

    My previous focus was on splitting on the rotation apart and smart pivot. I'll dedicate the next hours to the reposition jumps in collider transitions. I've already found and fixed the bug in the "Collision Ignore.mp4" you were sending me.
     
    Zan_Kievit likes this.
unityunity