Search Unity

New Standard Assets - a.k.a. Sample Assets, Beta Release

Discussion in 'Assets and Asset Store' started by duck, Jan 17, 2014.

  1. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Thanks I will look into it.

    Things that you can check however would be that the MobileControlRig is enabled on the DualTouchControls prefab instance in the scene and that MobileInput is set to enables from the TopMenu in the editor.
     
  2. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    it is, but all the ui widgets have sprite missing reference
     
  3. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Yes the Movetouchpad and the TurnAndLooktouchpad don't have sprites they are just used as areas for the touch controls. There is a small transparent text component that shows what the areas are. The jump button however should be visible
     
  4. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Hi

    Sorry if it has been brought up, but I recently had some customer support requests (for an Asset Store product) related to compatibility with the Third Person Character prefab. I haven't looked at other assets in the project, but assume there may be similar issues elsewhere

    1) The Third Person Character script needs to expose a layer mask for layers to ignore in the ground raycast and crouching sphere cast.
    2) The prefab hierarchy for the Third Person character is confusing and doesn't conform to best practices. Specifically, is there a reason that it has an animator on the top-level GameObject (with no avatar assigned by default, no less), as well as another animator on the child immediately below it? It seems it should just have the top-level parent with the animator (avatar assigned) and scripts, with the Hips hierarchy and skinned meshes immediately beneath it.
     
  5. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Hi again,

    I have another request for the Third Person Character. Right now, OnAnimatorIK() will set the character's looking direction. Could the first parameter value (for the overall weight) be exposed as a public field on the script? Right now, if the script is temporarily disabled and then reenabled, the character's torso and head will immediately snap back into place. Exposing this as a field would allow users to programmatically fade the effect back in.
     
  6. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    I suppose a simpler alternative might be something like adding the following:

    Code (csharp):
    1. public float lookBlendTime = 4f; // ADDED this field to specify how long look effect should take to blend in when enabled
    2. float lookWeight = 1f; // ADDED this field to allow looking effect to be blended in when re-enabling
    3. void OnDisable()
    4. {
    5.     lookWeight = 0f;
    6. }
    7.  
    8. IEnumerator BlendLookWeight()
    9. {
    10.     float t = 0f;
    11.     while (t < lookBlendTime)
    12.     {
    13.         lookWeight = t / lookBlendTime;
    14.         t += Time.deltaTime;
    15.         yield return 0;
    16.     }
    17.     lookWeight = 1f;
    18. }
    19.  
    20. void OnEnable()
    21. {
    22.     if (lookWeight == 0f)
    23.     {
    24.         StartCoroutine(BlendLookWeight());
    25.     }
    26. }
    27.  
    28. void OnAnimatorIK(int layerIndex)
    29. {
    30.     animator.SetLookAtWeight(lookWeight, 0.2f, 2.5f); // ADDED lookWeight parameter here
    31.  
    32.     if (lookTarget != null) {
    33.         currentLookPos = lookTarget.position;
    34.     }
    35.  
    36.     animator.SetLookAtPosition( currentLookPos );
    37. }
     
  7. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    I've added the layer masks you asked for in the next update.

    The third person character is setup that way so that you can delete the Ethan model and potentially drop in any other model as child and have everything work. It was a decision made to make the sample asset as flexible as possible.

    What you are asking for with the blending isnt really possible. When you activate yes you can smoothly blend back to a position but when you disable the script no code will run on it so you will always get the snap back to place.

    I have also added a mouse smoothing option.

    I will drop another reply in the thread once the submission to the asset store is complete
     
  8. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Thanks! The point about being able to drop another model in makes sense.

    With the blending, the solution I pasted actually does do what I want. Namely, I do not need to smoothly blend out, because my asset store offering, which takes over movement, just snapshots the current position and orientation when it is activated. I just need to be able to smoothly blend the third person looking back in when it is re-enabled.

    Maybe just exposing lookWeight as a public property is a good compromise here?
     
    Last edited: Sep 16, 2014
  9. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    In that case yeah that would make sense. I will make the change in the next update, which all going well, will be next Monday unless some massive bug surfaces.
     
  10. dart

    dart

    Joined:
    Jan 9, 2010
    Posts:
    211
    How can I set the rotation of the FirstPersonCharacter to the same rotation of a GameObject if I want to teleport it to a new location? I've checked the scripts of the prefab and the rotation is made using SimpleMouseRotator, which uses a variable, originalRotation, to compute the rotation every frame. After a telportatoin, If I just set the rotation of the FPC to the new rotation, it stays in that orientation to a small time and then reverts back to the rotation before the telport, or if I set localRotation and originalRotation to the new orientation, it completely messes with the axes. Any idea on how to set the rotation without any of these side effects?
     
  11. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    Hey dart,

    that is something I had not anticipated. I will look into a solution and get back to you on that.
     
  12. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    So if you add this function into the controller class you will be able set the view rotation as well


    public void SetViewRotation(Vector3 vec)
    {
    yRotation = vec.x;
    Vector3 eulerAngles = transform.rotation.eulerAngles;
    eulerAngles.y = vec.y;
    Quaternion quaternion = Quaternion.Euler(eulerAngles);
    transform.rotation.Set(quaternion.x, quaternion.y, quaternion.z, quaternion.w);
    }
     
  13. LEGEND383

    LEGEND383

    Joined:
    Aug 1, 2012
    Posts:
    20
    This is looking great so far :)

    The only problem I've had so far is getting the first person character to respond to the dual touch controls. I just added both prefabs to my scene, made sure that mobile input was enabled, and ran it and I get nothing (using the remote app on my phone to get touch input). This also doesn't work when building to my phone (phone runs android). The console doesn't show any errors or warnings.

    EDIT: I set up an empty scene with a dual touch prefab and a text box with a script to report the values of the touchpads and button to test what's happening. Whatever I do, they always report zero for the touchpad axis' and false for the button. Is anyone else having problems with this?
     
    Last edited: Sep 17, 2014
  14. neatgadgets

    neatgadgets

    Joined:
    May 13, 2014
    Posts:
    73
    How do I apply the Mobile character prefab to the character in third person?
     
  15. temac123

    temac123

    Joined:
    Sep 18, 2014
    Posts:
    2
    Hello,
    I am trying to add handbrake physics to CarController.cs or Wheel.cs, but I can`t put a car to side slide. How can i do this?
     
  16. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    UGUI doesnt automatically create an event system when you drag a gui based prefab into the scene. You will need to add that manually to the scene using the GameObject->UI->EventSystem command
     
  17. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    I'm sorry I am not sure what you are asking?
     
  18. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    What you would need to adjust is the sideSlideGrip variable. So when you activate the handbrake the wheels are then made as slidey as possible.
    This is all based on the 4.6 version of physics however and the version 5.0 car has been completely rewritten which includes handbrake.
     
  19. temac123

    temac123

    Joined:
    Sep 18, 2014
    Posts:
    2
    Where can I find this v5.0 car physics? Thank you!
     
  20. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    It's not available yet.
     
  21. LEGEND383

    LEGEND383

    Joined:
    Aug 1, 2012
    Posts:
    20
    Thanks for the reply. After adding the EventSystem the jump button works, but I'm still getting nothing from the touchpads. Also the joystick in the single stick control rig always goes to (1, 1), no matter which way or how much I move it, or what settings I use.
     
  22. neatgadgets

    neatgadgets

    Joined:
    May 13, 2014
    Posts:
    73
    I figured out how to get the movement happening on the mobile. I had to enable mobile. However the sample scene particles shows that if you click you explode the boxes, but I can't replicate that on the mobile. Do you know how to do this?
     
  23. LEGEND383

    LEGEND383

    Joined:
    Aug 1, 2012
    Posts:
    20
    Could you not do something like (in OnMouseDown):
    - cast ray from MousePosition using camera
    - spawn instance of ExplosionPrefab at ray hit point

    EDIT: Sorry, somehow forgot you wanted for mobile. In Update, you could iterate over the touches in Input.touches and cast rays from one or more of them as above.
     
  24. neatgadgets

    neatgadgets

    Joined:
    May 13, 2014
    Posts:
    73
    Maybe, I was just thinking it might be something already built-in. I'll have to do some more reading about Cast Ray. Didn't cover that in the course I did in Unity.
     
  25. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    If you look in the ParticleSceneControls script it will show you how to do this. The use of Input.GetMouseButtonDown(0) may be confusing but this is linked in the unity source to also be the first touch on mobile.
     
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Uhh which one is the latest version of the sample asset?? it's been a while since the last time i checking here
     
  27. Courvee Black

    Courvee Black

    Joined:
    Mar 15, 2013
    Posts:
    11
    Just a little question. Will be this assets compatible with Unity 5 or, maybe, they are compatible already?
     
  28. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
  29. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Unity5 will ship with these assets as part of the editor. They are the replacements for the standard assets.
     
  30. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    How many standard assets replaced??
     
  31. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    The old standard assets will be gone and these will take their place.
     
  32. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Uuh sorry your post are bit confusing to me, the old standard assets are : Character Controllers,Glass Refraction, Image Effects, Light Cookies, Light Flares, Particles, Physic Materials, Projectors, Scripts, Skyboxes, Terrain Assets, Toon Shading, Tree Creator, Water (Basic and Pro).
    all of them gonna be removed??
     
  33. Enemy-Ace

    Enemy-Ace

    Joined:
    Aug 18, 2014
    Posts:
    4
    I'm having an issue getting the Flight and camera scrips into my game.

    The Multipurpose camera does not seem to keep speed with the plane. It follows to some extent, but waaaayy to far.

    can someone help? thank you.
     
  34. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Some will remain but they will be upgraded for use in 5.
     
  35. lullaharsh

    lullaharsh

    Joined:
    Sep 9, 2012
    Posts:
    29
    Wow what a coincidence I also have iphone 4 and ipad 2
     
  36. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ah i see, that's good to know
     
  37. SurvivalGamesINC

    SurvivalGamesINC

    Joined:
    Sep 23, 2014
    Posts:
    2
    Hello, I'm trying this out for the first time but can't get this to work. I downloaded and imported the sample assets folder and then when to scenes and loaded a sample scene. When I hit play I get "All compile errors have to be fixed before you can enter play mode. What would be the cause of this? Scripts should be correct for versions 4.3 an up right? Any help would be much appreciated. Thanks!
     
  38. gboistar

    gboistar

    Joined:
    Jul 21, 2014
    Posts:
    3
    Hi guys,
    Is there a possibility to use Third Person Character on mobile with Legacy Animation? Without Animator?
    Thanks
     
  39. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    Which version did you download? There are two versions on the asset store one is for 4.3 and one is for 4.6. You may have downloaded the 4.6 version.
     
  40. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    No. We want to move forward and not have to support our legacy tech in that way. We want to provide examples on how to move forward and use our latest tech.
     
  41. SurvivalGamesINC

    SurvivalGamesINC

    Joined:
    Sep 23, 2014
    Posts:
    2
    Never mind, I figured out my problem. Just to update anyone who has problems using Unity 5.0 downgrade yourself to something like 4.5.6 I'm using this version and it works fine. I rigged a werewolf I built and finding this pretty awesome I can get this up an running to see how my character would work. Hopefully I can figure out how to make my own animations. Thanks for making this available for free man! If you continue to work on this and maybe create some kind of way to adjust the characters body I'd be willing to buy a copy. I just am now realizing I could of made my legs a bit longer on my character. I haven't completely looked over this asset though so maybe there is a way to do this already.
     
  42. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Did not realise you were on 5. The good news is that the version 5 compatible version of the standard assets will be shipping with the editor very soon.
     
    shkar-noori likes this.
  43. sti_22

    sti_22

    Joined:
    Oct 1, 2014
    Posts:
    4
    It is really nice asset. I really admire "Cross Platform Input". It works great.
    There is only one thing missing - possibility to automatically reposition joystick to first touch position (in given area). It increase experiences on small devices.
     
  44. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Thank you.

    It is something that we can look into. It doesn't seem like there are many "bugs" coming in on the assets anymore so small feature requests like this are something we can do.
     
  45. DSebJ

    DSebJ

    Joined:
    Mar 30, 2013
    Posts:
    101
    I'd love an extension to the Cross Platform input with an example GUI Screen (in the new GUI) to remap keys during runtime :)
     
  46. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Any plan to extending/enhancing the character controller??
     
  47. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Should be possible to some extent :). Might take quite a bit of doing but I will see what I can come up with.
     
  48. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    What do you have in mind? Throw some ideas at us and we will see what we can do.
     
  49. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Uhh.....maybe.... :
    - Climbing (small obstacle and high wall maybe :D )
    - Hanging and moving on Ledge??
    - Swimming
    - Sliding down the slope <- this was easy actually with the old character controller, but i haven't got a hang of the new one :p
    - Ladder

    Well since you're asking at least maybe those are the general people need for the basic template for character controller :D

    btw some question, i haven't checked this one actually so while i'm here maybe i'll ask anyway. is the character controller support moving platform??
     
  50. Mafutta

    Mafutta

    Joined:
    Sep 30, 2014
    Posts:
    45
    carbrakelights.PNG
    Guys, the sample assets are great. I can't get the breaks lights to work however on the unity car. Help please.
    MissingComponentException: There is no 'Renderer' attached to the "car" game object, but a script is trying to access it.
    You probably need to add a Renderer to the game object "car". Or your script needs to check if the component is attached before using it.
    BrakeLight.Update () (at Assets/Sample Assets/Vehicles/Car/Scripts/BrakeLight.cs:12)

    Nevermind: I found out where to set it up myself. Great!
     
    Last edited: Oct 2, 2014