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
    Some screen shots of whats happening would be best for me to gauge what is actually happening
     
  2. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    I set up a new scene with just a plane the third person character and the free look cam and this did not happen when I turned the variable to. I would recommend double checking that there is nothing else effecting it.

    The next update to these assets will come when we release 4.6. Not much will change however for that release. The major thrust of the work at the moment is getting everything in line for 5.0 release. I may attempt to back port some of the changes/fixes into the 4.6 version after that but it is very time dependent.
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    there's nothing else affecting these scripts, and it also happen even if the character are standing still, and it keep rotating to camera direction. Not the look at effect but it rotated whole body
     
  4. oc007061

    oc007061

    Joined:
    May 27, 2013
    Posts:
    10
    wheeleditor.cs has a problem. It says "wheel is defined multiple times" or something like that. I just remove the script and all's well! So other than that great pack.
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Oh btw since you are going to release final version of this can i request climbing and swimming for the character controller?
     
  6. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    I think "request" is the wrong word. You surely meant "implement", didn't you? :D

    I just don't think they're going to add such specific features, just a solid base to build upon/showcase.
     
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Well who knows :D
     
  8. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    We have another project in the pipeline that will mean we will have more mocap animation data at our disposal, so there will be some other new stuff added in the future. Just so you are aware the sample assets will likely be a completely ongoing thing from 5.0. So you can expect regular updates and changes to everything. Right now for instance I am actually taking everything back a notch or two from the initial beta release to make sure the base stuff is 100%. I would rather that it was solid before I start expanding on more elaborate features for it. They need to be handled in a way that newbies to unity can understand whats going on easily but also provide something that more advanced users can take advantage of and leverage in their projects.
    It is just trying to find that correct balance that can be a little difficult.
     
  9. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Hey tnetennba, I have a question.
    You said that you'll look into the rigidbody player again in future because they're not so easy to get right. I know that since I'm rolling my own solution now because I don't want to wait.
    I know it's very hard to make player movement feel snappy and having the player behave realistically when doing physical interactions with other rigidbodies, both at the same time.

    After hours of trying various approaches I think I have found the solution to the problem. I now have the base (only movement logic) for a player that:
    • Has snappy movement
    • Correctly interacts with other physics objects
    • Uses little code (no workarounds for workarounds for workarounds)*
    • Uses the physics engine without workarounds like super high gravity/forces/etc (player mass is set in kilograms which makes setting other masses in relation absolutely straightforward)
    *Right now player movement is far too snappy. You can change directions instantaneously without losing any momentum at all, which is not intended. So at least one workaround will be necessary.

    Since I wanted to OpenSource it anyway, I figured I'll just ask you whether you want to take a look at the code. Might save you some time. ;)
     
  10. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    Yeah send it over and I'll take a look.
     
  11. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    58
    Hi,
    Really Cool Assets. I love it.:):cool:

    But i dont like to use it in my project straight away cause i really really love to know how it works.:)
    I dont like to waste your precious time by asking some questions .But would you mind answering just a few question about the camera bob and the AI please :D.

    I like to learn new techniques and logic that's all.

    Thanks
     
  12. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    This is an open forum thread about the provided assets. If you have a question regarding them, just ask away.
    The developers probably aren't the only ones that can answer your questions. ;)
     
  13. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    As TheSniperFan said ask away. I tend to drop in on this thread in the mornings after my emails and then at various points during the day when I have time.
     
    deltamish likes this.
  14. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    i think i find out the problem here, it always happened when the char controller is on uneven surface. it sliding down and somehow it counted as the character is moving (even the sliding is so....slow that sometimes you didn't notice) so it rotate the character into camera direction.
     
  15. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Ah yes the sliding issue is known about and is on my todo list.
     
  16. Smartline-Games

    Smartline-Games

    Joined:
    Aug 15, 2013
    Posts:
    67
    Is this topic still 'active'?

    I'd still like to ask some questions :(
     
  17. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Yes, it is.
     
  18. Mons1999

    Mons1999

    Joined:
    Sep 24, 2012
    Posts:
    33
    Hello everybody
    Thanks to Unity for this wonderful package it helped me a lot!

    But I still have one question : the mass of the car is 1 kg, so it looks unrealistic in my game. When I put a realistic mass like 1600 kg, it becomes impossible to control the car or to rotate it.
    How could I change the settings to have a heavy controllable car ?

    Thank you
     
  19. Brainswitch

    Brainswitch

    Joined:
    Apr 24, 2013
    Posts:
    270
    A rigidbody's mass is not (necessarily) in kilograms (
    - the Unity manual).

    Impossible? I just tried setting the car mass to 1600 and while it feels heavier I could certainly control it. Can you control it at all?
     
  20. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Hi Mons, the car has been changed a lot for its final release. The update to physx that comes in 5.0 has meant that the current car setup you are seeing just simply didn't work correctly. As a consequence the mass and other properties are now more realistic, for example, the mass is around 1000 units ( trying to emulate a small sports car ) with a torque of around 500nm ( close to some ferraris ).
    It is also unfortunate that this newer version of the car will not back port into unity 4.6 so I can't provide a version with similar setup to solve your problem.
     
  21. RedDevil

    RedDevil

    Joined:
    Nov 19, 2013
    Posts:
    8
    Hi!
    I have a problem with the ThirdPersonCharacter script.I keep reciveing these errors and i dont know how to fix them:

    NullReferenceException: Object reference not set to an instance of an object
    ThirdPersonCharacter.PreventStandingInLowHeadroom () (at Assets/Imports/Sample Assets/Characters/Third Person Character/Scripts/ThirdPersonCharacter.cs:141)
    ThirdPersonCharacter.Move (Vector3 move, Boolean crouch, Boolean jump, Vector3 lookPos) (at Assets/Imports/Sample Assets/Characters/Third Person Character/Scripts/ThirdPersonCharacter.cs:87)
    ThirdPersonUserControl.FixedUpdate () (at Assets/Imports/Sample Assets/Characters/Third Person Character/Scripts/ThirdPersonUserControl.cs:79)

    Please help.Ty
     
  22. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Hi tnetennba, just curious is there a preset to create 4WD all terrain vehicle in the sample assets? something like warthog from halo.
     
  23. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    58
    thanks tnetennba

    Sorry for the late reply was busy with exams

    I wanted to ask may questions regarding AI and Unity Editor's
     
    Last edited: Jul 5, 2014
  24. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    58
    hi SniperFan sorry if i sounded rude I didn't mean that only developers should answer my question (anyone can)


    Sorry
     
  25. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    No problem. I fully understand you (exam time for me too ;))
    I'd love to answer your questions, but my code is based off an old version of their scripts and changed quite a lot and I'm no pro in Unity GUI.
     
  26. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    58
    Thnks for understanding TheSniperFan

    I have a few question regarding the AI and math behind it

    1.In AI Car script
    The car turns around to face the target so realistically .I really want to know how it works I always thought it as moving the object along a cricle whose radius depends on the velocity of the vehicle.But the script tells a whole new story I dont understand the part where it uses Atan and stuffs to make it turn. Can some one please tell me how it works and If possible could you also explain the math behind it as well.:D

    PS I would really love to know the math behind the car and aeroplaneas well .So if you have any rough idead please do share it with me. :)


    2. In Head bobing script
    SO how does the
    head bobing cycle what i mean is how to get the angle for the sin to offset the objects y position
    Could anyone please explain how the script does the offsetting .And the spring action too is awesome is it based on Hookes law.


    3.How to achieve phyics joint like effect
    i was working on a train simulator for which i wanted the Carraiges to follow the main train.For the turning
    I couldnt place colliders all over the tracks to make it turn realisticly as it would take a hell lot of memmory.
    So if there is any other alternative please do share it with me

    4.And how to darw elemets inside a box in Cutom Inspector you like the one in Shuriken particle system.
    Where the parameters are neatly enclosed in a box

    Could anyone please help me

    Thanks
     
  27. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Nevermind about my question....(below)
    Got it working with the current car preset, it works flawlesly :)
     
  28. Spetsdod

    Spetsdod

    Joined:
    Jan 6, 2014
    Posts:
    4
    Just started using the Sample Assets bundle to experiment with some new ideas and I'm getting a bunch of warnings every time I set up a new project and import the bundle (from the store, or from a previously downloaded package).

    There are several "MuscleClip" conversion warnings, and a few Cross Platform Input errors relating to UnityEditor.BuildTargetGroup.BB10.

    This is from a brand new project, with the Sample Assets bundle downloaded from the Asset Store. I have Unity 4.5.1f3 installed. Any suggestions as to what might be causing this, or if I should worry about it?

    Thanks in advance.

     
  29. Foj

    Foj

    Joined:
    Apr 11, 2013
    Posts:
    17
    Hi,
    I am using the First Person Character in my game. I am new to this level of developing in Unity and am just starting to add C# scripting skills to my art background – so please forgive the naivety of my question.

    I’ve tried to find a definitive answer but: am I correct in understanding that the First Person Character is ready for use with a standard (xbox-type) pc gamepad – that no additional mapping/scripting is required?

    If script changes are required, what and where are these found? Is there any documentation/tutorials about the First Person Character Sample Beta Asset?

    & just to say thank you for Unity and these amazing assets. :D
     
  30. eastfall

    eastfall

    Joined:
    Oct 15, 2013
    Posts:
    1
  31. Mish

    Mish

    Joined:
    Apr 23, 2010
    Posts:
    96
    Just wondering if there will come a raycast based CharacterController2D like there is for 3D or if this rigidbody based approach is the way to go in the new 2D system?
     
  32. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Hi sorry for the delay I have been out of the office.
    If the null reference is coming from the PreventStandingInLowHeadroom function then it would likely be that there is not a rigidbody attached to the character
     
  33. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Good to know. Again though bear in mind the car will be totally different in the 5.0 version of the assets. It has been completely stripped back.
     
  34. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    1) I didnt write the code for this, that was Duck ( might be worth shooting him a PM ), so I'll take my best stab at this.

    What it is doing is just getting the angle to the target and then combining with the steer sensitivity to make the car gradually turn towards the target.

    by
    • getting the target we are trying to get to in the cars local space
    • get the angle between the cars local x axis and the objects position using Atan2
    • combine the result with the steer sensitivity for gradual turning
    As for the math behind it all, again it is going to change. The car has already been done for 5 is now only ~200loc. I found that there was too much going on and it didn't provide the basic example that is needed. We could spend months creating the ultimate car and plane controllers that could be used for everything we could imagine but then someone might ask for a tricycle helicopter that can turn into a submarine and then we would have to make that work. It is better that we provide something that can be used as a basic model that the end users can then expand on, albeit probably with a little help from us through this forum thread, to make it work for their needs.

    2) I think you are using the old version for this which again is gone. We had some feedback from some industry professionals about the head bob and what needed to be changed on it. It is now controlled from an AnimationCurve and some multipliers. There should be a small package on this thread that will show you the update. I think sniperfan found some issues with the scaling on it but it should be okay now. Well okay in that if you want something insane you can do that.

    3 + 4) These are not specific to this thread so I would open a new thread asking for help with this, just to avoid cluttering this one up as much.
     
    deltamish likes this.
  35. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    Hey Spetsdod, you can ignore those warnings for the time being. The next update for these assets will be when we ship 4.6 and they will all be using the new gui system we have been working on. The code etc will be updated then to remove these problems.
     
  36. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    It will work but you will need to update the input manager to include the correct joypad axes and buttons by name.

    Take a look here
    http://docs.unity3d.com/Manual/class-InputManager.html

    Then in the various places where the axis are called in the code make sure that these are setup in the input manager
     
    Foj likes this.
  37. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    It is a known bug and will be fixed in future updates.
     
  38. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    There are no current plans to change our approach to this but that's not to say that there are not other ways to go about creating a 2D character controller.
     
  39. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    No problem i think, i just need to re adapt it :).
    Btw is there a way to check if the TPS character controller is sliding?
     
  40. Spetsdod

    Spetsdod

    Joined:
    Jan 6, 2014
    Posts:
    4
    Great, thanks for the response! I will ignore the errors for now.

    One more question about the assets. I'm pretty sure I know the answer from my other research, but if I import the entire Sample Assets bundle, but only use one or two assets, when I build the project, does the size of the project reflect the entire bundle, or only the two assets I actually used?

    I'm concerned that if I import several packages but don't prune out the unnecessary assets that my mobile apps are going to end up massively huge.

    Thanks for all the great work!
     
  41. RedDevil

    RedDevil

    Joined:
    Nov 19, 2013
    Posts:
    8
    thank you for youre reply but I have asked on Unity answers aswell and i found no solution yet.My character does have a capsule collider and a rigidbody atached just like Ethan has.
    This is the full error:"
    NullReferenceException: Object reference not set to an instance of an object
    SorcererThirdPersonController.PreventStandingInLowHeadroom () (at Assets/Scripts/SorcererThirdPersonController.cs:152)
    SorcererThirdPersonController.Move (Vector3 move, Boolean crouch, Boolean jump, Vector3 lookPos) (at Assets/Scripts/SorcererThirdPersonController.cs:98)
    ThirdPersonUserControl.FixedUpdate () (at Assets/Imports/Sample Assets/Characters/Third Person Character/Scripts/ThirdPersonUserControl.cs:79)
    "
    at 152: "Ray crouchRay =newRay(rigidbody.position +Vector3.up * capsule.radius * half,Vector3.up);"
    at 98: the call for lowheadroom: "PreventStandingInLowHeadroom();"
    at 79 in the other script: "character.Move( move,crouch,jump,lookPos);"
    Ty for trying to help.
     
  42. Foj

    Foj

    Joined:
    Apr 11, 2013
    Posts:
    17
    Thank you so much for this answer. Not getting it though (sorry). I have (just bought) the Microsoft Xbox 360 gamepad. The arrow/wasd keys work on the left joystick straight-out-of-the-box. It's the 'simple mouse rotator' script (I guess), I want to map to the right joystick: looked at the script and looked at the Input manager - not a clue! I will keep digging, but wanted to get this request for further help out, ideally I need to get this going for July 11th. *I still need the keyboard and mouse to work too*. Thank you.

    ...having read a little, I have not changed the inputManager at all. It has 22 slots (size), only Horizontal, Vertical, Fire 1,2,3 and jump appear to be mapped to any input? (all these slots are then repeated, and empty, bar the jump slots that are mapped to joystick buttons). There are 5 empty Xbox360 controller slots towards the bottom (Xbox360Controller: RightX; RightY; DpadX; DPadY; Triggers).

    I guess I am trying to map "inputH" & "inputV" from the 'simple mouse rotator' script to the 4th & 5th axis of the Xbox gamepad?

    If I am in-the-ball-park, is there any step by step guide for total-idiots as to how to achieve this? Thank you.

    ***UPDATE: Seems to work now (I think) -
    It was very easy in the end. I created two new slots (size) in the InputManager (Edit> Project Settings). The names are 'Mouse X' and 'Mouse Y' (not as I guessed above). Then simply map them to the 4th and 5th axis under the Axis drop-down. It helps to have a detailed image of the Xbox controller, there's one here (along with other interesting looking resources): http://wiki.unity3d.com/index.php?title=Xbox360Controller

    Hope this helps someone else.

    Thank you for your help tnetennba.

    ***LAST UPDATE ON THIS (honest) -
    So whatever it is I have mapped to the right joystick to it is very rough compared to the mouse control. I get either left-right or up/down and no blending of these. Anybody know what I have done wrong?
     
    Last edited: Jul 10, 2014
  43. Mi_Gr

    Mi_Gr

    Joined:
    Dec 5, 2013
    Posts:
    17
    First of all, great assets!! :)

    But now I want to implement for the ThirdPersonCharacter a moving platform ability ... Can anybody help me, please, where I can to adapt the speed/velocity of platform?

    Thanks in advance!
    Michael

    Edit: This is code for fixedUpdate(), but it doesn't works ...

    public float movingPlatformFriction = 7.7f;
    private Vector3 movingObjSpeed;

    voidFixedUpdate()
    {
    float dist = collider.bounds.extents.y;
    RaycastHit hit;
    Vector3 speed = new Vector3(3, 0, 0);
    if(Physics.Raycast(transform.position, Vector3.down, out hit, dist + 0.05f))
    {
    //movingplatforms
    if (hit.transform.tag == "MovingPlatform")
    {
    Debug.Log ("FixedUpdateMovingPlatform?!");
    movingObjSpeed = hit.transform.rigidbody.velocity;
    movingObjSpeed.y = 0f;

    rigidbody.AddForce(movingObjSpeed * movingPlatformFriction * Time.fixedDeltaTime, ForceMode.VelocityChange);
    //this.transform.rigidbody.velocity = movingObjSpeed;
    //hit.transform.parent = this.transform.parent;
    //rigidbody.MovePosition(rigidbody.position + speed * Time.deltaTime);
    }

    }


    }
     
    Last edited: Jul 10, 2014
  44. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    It would take a small amount of work if you wanted to expose it but you could use a combination of the velocity variable ( Rigidbody.velocity ), the onGround bool to tell if the character is on the ground and if the input from the user was zero. This would allow to have a check for if the character is on the ground a sliding.
     
  45. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    It should not include anything that is not needed in the project. There is a script out there that can help to remove unused assets from a project:

    http://zaxisgames.blogspot.co.uk/2012/02/automatically-locate-all-unused-assets.html

    It is something that I have looked into in the passed but the problem of removing unused assets is not an easy one dude to the resources folder, things only referenced from script and asset bundles.

    Hope this helps.
     
  46. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176

    On this line of code there are only two things that can be null

    Ray crouchRay =newRay(rigidbody.position +Vector3.up * capsule.radius * half,Vector3.up)

    The rigidbody and the capsule.
    The capsule is already checked in the Start function to see if it has been set correctly or not:

    if (capsule == null)
    {
    Debug.LogError(" collider cannot be cast to CapsuleCollider");
    }

    So I can only assume that if that message is not showing then it must be the rigidbody that is null.
     
  47. RedDevil

    RedDevil

    Joined:
    Nov 19, 2013
    Posts:
    8
    Thank you for your response.I dont know whats happening i even removed the one that it was and added it again.I see no problems with it in game except for the error that im getting no funny movement.
    I also did a check and it does not appear to be null...
    if (rigidbody != null) {
    print ("is not null");
    }
    else print ("is null");
     
  48. Foj

    Foj

    Joined:
    Apr 11, 2013
    Posts:
    17
    InputManager_01.jpg

    Using the First Person Character, I am unable to get the Xbox right joystick to work the in same way as the mouse. I presume the Input Manager gets 'Mouse X' and 'Mouse Y' from the SimpleMouseRotator script for both the mouse and gamepad. At the moment, the Xbox right stick will do only up /or/ down /or/ left /or/ right one at a time - it does not blend these directions like the mouse, e.g. moving both up and to the left simultaneously and so on. I attach the Input Manager settings (sensitivity is purposely down - but assume this has no bearing). If anyone can describe how to get the 'blend' between directions working on the Xbox right-joystick like on the mouse it will be very much appreciated. Thank you.
     
    Last edited: Jul 13, 2014
  49. neatgadgets

    neatgadgets

    Joined:
    May 13, 2014
    Posts:
    73
    Hi,

    Is there a single over-ride to stop all input for the ThirdPersonCharacter? Basically I want when the game has ended or before it starts to not have any input control until the game is started, but still see the character on screen.
     
  50. markharkness

    markharkness

    Unity Technologies

    Joined:
    Nov 2, 2010
    Posts:
    176
    send me a PM with a unity package of the problematic scene and I will take a look.