Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

Official Say hello to the new Starter Asset packages

Discussion in 'Assets and Asset Store' started by UnityHas, Jun 9, 2021.

  1. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17
    Thanks alot for the help!

    So Ive finally got a nice feeling third person controller, however I do have a question.

    The code which calculates the speed, it uses the speed of course to set an animation parameter which the changes states of a blend tree. However I find my speed value oscillating between random numbers as it is about to hit 0 it jumps all over like 1.43453e-8 4.84565e-8 etc eventually to settle at zero, this only happens when I move and come to a halt i.e. no input. Looking at the code w=it does this:

    Code (CSharp):
    1. _animationBlend = Mathf.Lerp(_animationBlend, targetSpeed, Time.deltaTime * SpeedChangeRate);

    Looking at the docs for
    Mathf.Lerp(float current, float target, float interpolationValue)
    , the last parameter is the interpolation, which seems like its clamped from 0 to 1 and this .5 would be the midpoint between the current value and the target value.

    So I might be wrong but using
    Time.deltaTime * SpeedChangeRate
    really would produce some random number? and thus it will eventually hit 1 and the value finally settles at zero but not always?

    Could
    Mathf.MoveTowards
    be an alternative or is there something I am missing?

    Edit: I have tried
    Mathf.MoveTowards
    and all seems fixed (i.e. no oscillating between random values until it eventually hits 0), guess I just need a sanity check?
     
    Last edited: Feb 14, 2022
  2. artnerdray

    artnerdray

    Joined:
    Oct 10, 2020
    Posts:
    2
    Hi. I'm still learning and I'm more of an artist than an programmer.

    I did some basic animations to match what I saw the robot has. However I am having one issue I'm not sure how to fix. There is a slight hover before landing. But it only occurs when jumping up and landing on something higher than what was jumped off from. Like the boxes.

    Here is a video.


    I've tried using the existing animation that were on the robot, on my character and the hover was fixed. So this leads me to believe that my animation has the issue. Perhaps timing or position of the character related to the origin? I've tried adjusting both of these as well as matching what position the robot animations are. But no luck.

    One guess is my animations are at 60 frames per second. Would changing them to 30 fps help?

    I'm using Blender 3.0 and the Auto-Rig Pro. The Auto-Rig Pro also has an exporter that I've used to make the fbx. I'm exporting the model and animations all as one file.

    thanks for any help you can provide.
     
  3. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17
    Would be interesting to see where the grounded sphere is located on your character if you are using the thirdpersoncontroller script. Just click on the object that has the script attached and make sure the editors Gizmos button is selected and you should see where the grounded sphere is located. Perhaps it is too low and the character is being grounded earlier then it should be?
     
    artnerdray likes this.
  4. artnerdray

    artnerdray

    Joined:
    Oct 10, 2020
    Posts:
    2

    That was it!!

    My original animation was a bit longer than the original so it actually helped with timing to lower the grounded sphere to it detected it sooner and trigger playing the landing animation sooner.

    Thank you for the help!
     
    dkamp likes this.
  5. Bonesplitter

    Bonesplitter

    Joined:
    Feb 19, 2018
    Posts:
    2
    Hi! :)
    How to make camera movement smooth?
    At the moment, due to the movement of the camera in micro jerks, I get seasick and my eyes hurt.
    (using Unity 2020.3.28f1)
     
  6. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    770
  7. ZAN1-2-3

    ZAN1-2-3

    Joined:
    Jun 6, 2020
    Posts:
    1
    Does anyone know how you can attack using the new Input System. Using Unity's Free Character Controller.
     
    Last edited: Feb 21, 2022
  8. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    770
    you set up inputs using the input system. you then add attack animations to the controller. you trigger the attack animation in code when the player use the input. do some other stuff to ensure the attack works on the enemy.
     
  9. thundercat71

    thundercat71

    Joined:
    Sep 13, 2018
    Posts:
    10
    Camera shake and jitters:
    In the latest version of Unity (2020.3.29f1) if you load the Core template for First Person Controller there is no stutter on the rotation even though it is using "some" parts of the same asset.
    So has this stutter issue on rotation been fixed but not implemented yet to the main asset or some other voodoo going on?
     
  10. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    1.43453e-8 and 4.84565e-8 are effectively zero. You're seeing these numbers because the way computers handle floating point values has inaccuracies. So instead of 0 you sometimes end up with 0.00000000143453 which is the same as 1.43453e-8.

    Using Time.deltaTime * SpeedChangeRate or MoveTowards instead of a lerp will produce a different curve, which will have a different game feel. If we were lerping with a T that increased linearly from 0 to 1 then it would be a straight line and it would be equivalent, but using a T of deltaTime * RateOfChange creates an exponential curve which has a smoother acceleration and deceleration.
     
    dkamp and ch715t0 like this.
  11. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    That's exactly right. I was given the opportunity to fix some bugs while they were creating the template that still need to make their way back into the asset store version.
     
    dkamp and thundercat71 like this.
  12. thundercat71

    thundercat71

    Joined:
    Sep 13, 2018
    Posts:
    10
    Though if I start a new scene and unpack NestedParent_Unpack the I get jerky camera shake again unless I set
    upload_2022-2-21_19-37-5.png

    The original settings being in the template:
    upload_2022-2-21_19-36-7.png

    So not entirely sure what is going on.
     

    Attached Files:

  13. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    770
    cinemachine doesn't work with the new input system. that is what is going on.
     
  14. teli-unity

    teli-unity

    Joined:
    Apr 6, 2017
    Posts:
    10
    How to disable full-screen touch camera movement?

    Any help on this for touch devices
     
  15. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    I'm looking into it. I'm not sure why it was set to fixed update in the first place because, in my experience, processing input in fixed update tends to be a bad idea unless you know exactly what you're doing.
     
  16. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    Which youtube video are you referring to? What version of Unity are you using? Are you using the playground scene or a new scene?

    I believe the playground scene already has the joystick prefabs setup, you just have to enable them. I'm not sure how to help without investigating your project, but maybe if I follow the same youtube video I can pinpoint the issue.
     
  17. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    770
    the movement is not smooth either way. is unusable on fixed but on dynamic it doesn't work fine anyway.

    and that fixed an dynamic I think is important for physics. maybe. I was not able to find a clear description of what it does.

    why this behavior of avoiding recognizing that it doesn't work? We all play games and we know how the camera should feel.

    I know all of you have unreal installed, just create a third person starting template there and check how the camera should move.
     
  18. teli-unity

    teli-unity

    Joined:
    Apr 6, 2017
    Posts:
    10
    More details are mentioned in the comment posted earlier
    I followed the video in the first comment in this post.
    I'm using Unity 2020.3.14f1 and 2021.2.3f1 WebGL builds gives the same result. I'm using my own project scene.

    Yes, I'm using the same Joysticks and joysticks works. But touch on full-screen (overlapping with joystick controls) camera movement also works with that, and I couldn't able to find how to disable that on touch devices.
     
  19. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    So the problem is in WebGL on touch devices? Or is it present in Android and iOS builds as well? Did you try the playground to see if it works correctly there? Is there a chance that you added both the joysticks as well as the touch zones to your scene?
     
  20. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17
    What's the fix for this? As I have noticed this too
     
    Last edited: Mar 1, 2022
  21. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17
    Ahh yes brain fart, sorry it was because I set up animation transitions based on the speed being less then and greater then 0, however because it takes a few seconds to settle at 0 this caused some issue. But since changing that the animation into seperate layers who's weight I change this was jot an actual issue and I've since reverted.
     
  22. softballs

    softballs

    Joined:
    Jun 29, 2020
    Posts:
    1
    how can i have the camera follow the mouse and behind the player?
    i want the camera to follow the rotation of the player so it's always facing the back of the head

    i see in the controller there's this, but i don't know what to change to get it to do what i want

    Code (CSharp):
    1. // Cinemachine will follow this target
    2.             CinemachineCameraTarget.transform.rotation = Quaternion.Euler(_cinemachineTargetPitch + CameraAngleOverride, _cinemachineTargetYaw  , 0.0f);
     
  23. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    250
    Hello everyone,

    i have a question, is it allowed to include content from the starter assets in a custom paid assetstore package for showcasing purposes - like for example to use it in the packages demo scene(s)?

    Thanks and best regards,
    Kreshi
     
  24. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17

    Check this out: https://assetstore.unity.com/packages/tools/utilities/asset-store-tools-115#description

    Specifically in the overview FAQ section

    https://support.unity.com/hc/en-us/...mit-an-asset-that-uses-Unity-Standard-Assets-
     
    Kreshi likes this.
  25. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17

    So I have done this, however, the code you are showing is used to rotate the cinemachine target to the input, what you want to change is the players rotation from:

    Code (CSharp):
    1. float rotation = Mathf.SmoothDampAngle(transform.eulerAngles.y, _targetRotation, ref _rotationVelocity, RotationSmoothTime);
    2.  
    to:

    Code (CSharp):
    1. float rotation = Mathf.SmoothDampAngle(transform.eulerAngles.y,
    2.                     CinemachineCameraTarget.transform.eulerAngles.y, ref _rotationVelocity, RotationSmoothTime);
    Notice I use the cinemachine follow targets rotation instead of the rotation given by _targetRotation as that rotation goes with the I put direction. This way we rotate our player to face the cinemachine follow target (which follow the mouse) So that should work, at least it did for me
     
    Last edited: Mar 1, 2022
  26. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17

    @bronsonzgeb Hi again, please I wanted to know what changes these are?

    I'm currently trying to add recoil to the third person controller, and the way the cinemachine target is used is simply set to the exact rotation of the mouse no smoothing or anything, which makes sense for a perfect aim, but I assume it's causing the camera jitter when you move the mouse slowly and of course makes it hard to apply recoil, as I would want my recoil to be smoothed (Quaternion.Slerp or simialr) and then my looking not to be smoothed (well i mean like it currently is on the 3rd perspn controller asset, but with no jitter) but switching between the smoothed and unsmoothed doesn't seem great.

    I solved this previously by using AxisState (as it has acceleration, deceleration, and does its own smoothing etc to reach the value, but again I am unsure of the correct solution to have a nice feeling for a 3rd person shooter as well as still allowing recoil to happen.

    I see the FPS starter asset has RotationSpeed and uses transform.rotate, but I'm not sure how to apply this or if it's even what I want to be using, is there a difference between the template project and the fps asset on the asset store? I'm using 2022 so I'd need to install that just to see the fixes
     
    Last edited: Mar 7, 2022
  27. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    The main fix is not multiplying the mouse input by delta time. The reason why is here and the code that I used is here. (Check line 74 and line 120). It's not my favourite solution because it relies on a string lookup into the input actions, but it's the only workaround I found that works when using the Send Message behaviour, which we believe is the most accessible way to implement the Input System.

    As far as I can tell there might be an additional cause that affects some of the users, but I haven't been able to reproduce it so we haven't been able to fix it. So let me know if the problem persists.
     
    dkamp likes this.
  28. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    As far as I know the only differences between the Asset Store version and Template version was the fix mentioned above and a tweak to the cinemachine clamping values to prevent the camera from looking a full 90 degrees up or down because doing so throws an error.
     
    dkamp likes this.
  29. dkamp

    dkamp

    Joined:
    Feb 12, 2021
    Posts:
    17
    Thank you for this!

    And with regards to having recoil, what can I do here? I see the thirdpersoncontroller sets the cameras look at rotation immediately i.e. rotation = XXX; Where as Id love to have it Slerp or slowly smooth to the value, as basically all my recoil is negated when the CameraRotate method is called, as it then takes the input system values of the mouse and sets the look at's rotation to that.

    Would a simple Quaternion.Slerp in CameraRotate work or would you think AxisState might be better, as it does all this internally?

    I know I might be better off testing this, but I just want to know if there is perhaps any reason to use the one over the other (AxisState or manually Slerp the look at's rotation) when it comes to a nice feeling for mouse look at in a shooting type game and of course accurate.
     
  30. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    To be honest, I've never worked on a shooter before, so I'm probably not the best person to ask. If it were me, I would probably use the Quaternion.Slerp method (or at least something similar) because I prefer manual control over most of my gameplay code. On the other hand, if you had a good experience using AxisState in the past then maybe you can leverage that to reach a good result faster. Also, personally, I think it's dangerous to assume that something might be better just because it's an internal tool. Internal code has to be more generic, which means it was written without the concerns of your particular project in mind, which can be a huge source of headaches.

    So I guess my advice is: use AxisState if you think it'll get you to a good result faster with less code, but don't be afraid to drop it and go the manual route if you have to.
     
    dkamp likes this.
  31. vimalnar

    vimalnar

    Joined:
    Aug 4, 2016
    Posts:
    3
    Hi there, I'm new to cinemachine but hoping someone could help.

    I'm creating a new 3d platformer which uses keyboard input only, and would like to configure the cinemachine camera controller to follow the player including his rotation. How can i configure my freelook camera to turn when he turns - essentially locked to the rotation of the player instead of always being behind???
     
  32. JonesyLeo

    JonesyLeo

    Joined:
    Jan 8, 2017
    Posts:
    3
    Welcome fellow coders.
    I give up on make the "UI Joystick interface" run on the Third Person Controller.
    The mobile commands doesn't work.
    No way. 3 days lost. I ask for help.

    To make some test, I create a brand new Project: 3D Mobile Core
    • Unity 2020.3.25f1
    • Input System 1.2.0
    • Starter Assets - Third Person Character Controller 1.0
    • Platform: Android
    My steps:
    • Imported the Input System 1.2.0
    • Imported the Starter Assets - Third Person Character Controller 1.0
    I'm working in the Playground scene.
    And up to these steps, when I run the player in editor, the game runs perfectly with Mouse and Keyboard.

    So I followed the Starter Assets PDF and followed these steps:
    • Activated the GameObject UI_Canvas_StarterAssetsInputs_Joysticks (it was already in Hierarchy)
    • in this same GameObject, the PlayerArmature (Starter Assets Inputs) was already selected in the component "UI Canvas Controller Input"
    • in this same GameObject, the PlayerArmature (Player Input) was already selected in the component "Mobile Disable Auto Switch Controls"

    • In the PlayerArmature GameObject, i dragged the UI_EventSystem (it was already in Hierarchy) in the component "Player Input" > UI Input Module

    Ok, after all these steps, neither the sticks nor the player aren't moving at all, neither in the Editor Player Mode, nor in the Unity Remote in Android nor if I build the game.
    The game in editor mode still runs perfectly with Mouse and Keyboard.


    I'm astonished.
    It could be a very simple error, but it's very strange.
    In the Project Settings, under Input System Package, the "Supported Devices" List, is set to Empty, so the Touchscreen should be automatically recognized. I suppose.
     

    Attached Files:

  33. mingdong88

    mingdong88

    Joined:
    Dec 15, 2021
    Posts:
    1
    Can I use Input (Old)?
     
  34. cbritez

    cbritez

    Joined:
    Sep 8, 2018
    Posts:
    1
    Hello! Is there a way to make the UI_Virtual_Touchzone behave like the UI_Virtual_Joystick in an analog way? I'm trying to use it to move the camera, but it moves at only one speed
     
  35. mikaelK

    mikaelK

    Joined:
    Oct 2, 2013
    Posts:
    263
    Nice asset.
    I actually ended up using this package as a integration demo/ proof of concept for my plugin.
     
    bronsonzgeb likes this.
  36. MrsMcCullough

    MrsMcCullough

    Joined:
    Jan 4, 2022
    Posts:
    1
    HELP! I teach a HS class and a few computers are not liking this asset. Everything looks fine, there are no compiler errors, but nothing works when they test but the UI.
     
  37. Mackas84

    Mackas84

    Joined:
    Feb 12, 2022
    Posts:
    1
    Hello,
    I have a problem with Rigidbody push, when I push object. When I push an object, it flies away as if it had no mass. Rigidbody weight settings have no influence.
     
  38. MikeRoeGames

    MikeRoeGames

    Joined:
    Jul 21, 2021
    Posts:
    2
    Hello there, I'm having an issue with the 3rd person camera. When I move it in game play it dose not smoothly move with my mouse, instead it snaps or jitters. Dose anyone have any idea why this is or how to fix it?
     
  39. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    770
    I've talked about this issue but after some initial promising replies it got ignored. I know this is an issue between cinemachine and the new input system. This demo, from this thread is broken because of that. Yet no one updated this.

    https://forum.unity.com/threads/can...inemachine-with-the-new-input-system.1191883/

    https://forum.unity.com/threads/def...cinemachine-or-is-cinemachine-broken.1192303/

    not that anyone cares but this issue finally broke my patience and I've moved to unreal. It took some time to adapt to the new environment but I've made satisfactory progress on my game after going nowhere for two years in unity.
     
  40. MikeRoeGames

    MikeRoeGames

    Joined:
    Jul 21, 2021
    Posts:
    2
  41. dorusoftware

    dorusoftware

    Joined:
    Jul 5, 2012
    Posts:
    770
    yes, that "fixes" the issue but actually it make it less visible. is still there. unfortunately because I still don't understand which is best of the two options and what those options do for other unity systems it means one will probably have issues down the road.

    This is for people who actually want to build a game. Is fine if you just learn and do some simple tests. That is the issue actually with unity. You play around no issues, try to actually build a complete game and then you get all bugs and stuff that doesn't work or cooperate with each other.
     
  42. justinwoodart

    justinwoodart

    Joined:
    Jun 23, 2015
    Posts:
    3
    When I enable the mobile joystick mode, the structures in my game become invisible on Android. I can see that the physics are working since the walls are still there, but everything is see-through. What am I missing here? UI(default) textures are visible, but nothing else.
     
  43. JoshuaPitanielloCreator

    JoshuaPitanielloCreator

    Joined:
    Feb 13, 2019
    Posts:
    3
    lol? Why does Unity Remote not work with this?
     
  44. justin123089

    justin123089

    Joined:
    May 17, 2016
    Posts:
    4
    So when I use the first person or third starter template that says core. It will not let me download assets into unity properly. Every single asset that I import is always missing the meshes or something. But when I do it in a regular empty project they are fine.
     

    Attached Files:

  45. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    This looks like a mismatch between materials and render pipelines. I believe the starter templates use URP (the Universal Render Pipeline), whereas a regular empty project uses the Built-In Renderer.

    In the project where all your trees are pink you can use the Render Pipeline Converter (Window > Rendering > Render Pipeline Converter) and choose "Built-in to URP" from the dropdown. Then you should see some materials under "Material Upgrade" that need to be converted.

    upload_2022-4-7_13-53-29.png

    I hope that solves the issue!
     
  46. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    There's a strength value on the push component to control the strength of the push. If you'd like the script to take mass into account I'd modify line 33 of BasicRigidBodyPush.cs to this:
    Code (CSharp):
    1. body.AddForce((pushDir * strength) / body.mass, ForceMode.Impulse);
    This will modulate the strength of the impulse based on the mass of the object being pushed.
     
  47. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    If you want to use the old input system exclusively you'll have to port the asset. Otherwise I suggest setting the "Active Input Handling" in the Player Settings to "Both" which will allow both systems to be used simultaneously.
    upload_2022-4-7_14-10-40.png
     
  48. teli-unity

    teli-unity

    Joined:
    Apr 6, 2017
    Posts:
    10
    Yes, I tried on devices Android and iOS, but still, the issue is the same in my scene. So the problem is in touch devices WebGL, Android, and iOS.

    Then I also tried the playground scene, it worked fine as expected.

    So sharing the hierarchy screenshot of my scene that I only have Joystick, not the touch zones. While I just changed
    • the 3rd person to 1st person by changing the Camera Distance value to 0 in CinemachineVirtualCamera. But I don't think it is the issue
    Other than this everything is the same



    Just for reference, my real question, and explanation is here.

    Sorry for the late reply, I got a bit busy.
     
    Last edited: Apr 21, 2022
  49. bronsonzgeb

    bronsonzgeb

    Unity Technologies

    Joined:
    Aug 10, 2020
    Posts:
    101
    Is there any chance you can share the project so I can take a look?
     
  50. EmmaUnity

    EmmaUnity

    Unity Technologies

    Joined:
    Jan 30, 2020
    Posts:
    15
    Hi all!

    This week, we released a small update to the Starter Assets package (version 1.1), fixing various issues and testing for compatibility with the new 2021 LTS.

    This is the full changelog for this update:

    Starter Assets - Third Person Character Controller:
    • Added footstep sounds to the PlayerArmature
    • Added landing sounds to the PlayerArmature
    • Fixed issue where camera would rotate away from the initial direction
    • Changed Input System update mode from Fixed Update to Dynamic Update to solve an issue where sensitivity would increase dramatically and jitter
    • Updated some scripts to handle joystick motions differently than mouse motions
    • Animation tweaks (jump and land)
    • Small fixes to tooling
    • Tested for compatibility with Unity Editor 2021.2
    • Fixed an issue with virtual input on Unity Editor 2019 LTS
    • Documentation updated with an overview on layers, footstep SFX (Third Person only), landing SFX (Third Person only), and how to add a custom character or animation set

    Starter Assets - First Person Character Controller:
    • Fixed issue where camera would rotate away from the initial direction
    • Changed Input System update mode from Fixed Update to Dynamic Update to solve an issue where sensitivity would increase dramatically and jitter
    • Updated some scripts to handle joystick motions differently than mouse motions
    • Small fixes to tooling
    • Tested for compatibility with Unity Editor 2021.2
    • Fixed an issue with virtual input on Unity Editor 2019 LTS
    • Documentation updated with an overview on layers, footstep SFX (Third Person only), landing SFX (Third Person only), and how to add a custom character or animation set
    We hope you will enjoy the small update and continue to use the Starter Assets packages!
     
    PutridEx and Kreshi like this.
unityunity