Search Unity

Official 3D Game Kit Official Thread

Discussion in 'Community Learning & Teaching' started by Aurore, May 9, 2018.

  1. _malcolm

    _malcolm

    Joined:
    Mar 4, 2019
    Posts:
    6
    Everyone else: Sorry for this LONG post.

    @Runemark on a separate topic, I'm following your video on adding ranged weapons. I'm more than halfway through with no issues, but now I have one. at 44:19, you drag the PistolRoot over the Ellen_Right_Hand_Attach with no problems. I can't do this. It gives me this (error 1):
    upload_2019-3-5_19-37-23.png

    I can, however, drag the Ellen_Right_Hand_Attach over to the PistolRoot's Fixed Update Follow method... does that achieve the same effect? This is probably just a setting change I need to make, but being a newbie, I don't want to change settings if not needed in case I mess something up...

    At 44:30 in your video, it shows the pistol highlighted at ground level, before you attach it. Mine doesn't show the pistol at all when I select it, only the axis (error 2):
    upload_2019-3-5_19-48-13.png

    I tried moving it, just to make sure it wasn't covered up...it wasn't. Looking at my Inspector versus yours, they look the same, minus the fact that I can't move mine under Ellen's right hand.

    I'm stuck in the tutorial at this point until I get at least the first problem above figured out. Oh yeah... I still can't move the scene around with the mouse when in play mode. Nothing to do with your tutorial, it was like that when I first open the 3D Game Kit and hit play. Settings look correct for input, but again, being new, I am sure I am missing something. (error 3)
    upload_2019-3-5_19-54-6.png
    upload_2019-3-5_19-55-12.png
    upload_2019-3-5_19-56-47.png

    Any help you can provide...thanks! Oh, and your video tutorial is really good, thanks. I like that you don't rush it, and that you speak/talk your way through it. Very helpful.
     
  2. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    121
    @_malcolm
    1. The first problem is not actually a problem. In the video, I'm using an older version of Unity. The prefab mode is a new feature came up in the recent update.
    You can click on the "Open Prefab" button. This will load the prefab editor scene, where you can move the pistol freely. (you can learn about this here).

    2. The Pistol GameObject is turned off by default. You can activate by toggling on the checkbox in the top-left corner in the inspector (here, the red box shows where you can find it).

    3. Not sure about this, the input settings look fine to me. This is how the CameraRig should look like.
    Possible problems can be:
    - Follow is not set: you can assign your player transform here.
    - Look At is not set: you have to create a transform as a child object of the player (Ellen contains this transform, with a name of HeadTarget)
    - Input Choice isn't set right: 3D Game Kit has two option for controll, keyboard+mouse and a controller. You have to select the one you will use.

    upload_2019-3-6_8-29-42.png

    Additional Problems might be:
    The CinemachineFreeLook component on the children of the CameraRig isn't set well.
    • Check the AxisControl part, and make sure the MaxSpeed for the Y-Axis and for the X-Axis is set to the right value. (I use 10 for Y and 500 for X)
    • Also, make sure the Input Axis Name is the correct name: CameraY and CameraX should be
    These are my tips so far, hope it helps.

    Self-promoting - ON
    Also if you wondering where that screenshot came from, it's our upcoming stealth game that is based on the 3D Game Kit, well at least in the current prototyping phase. We'll start posting dev blog from this week if you want to follow ;)
    Self-promoting - OFF :D
     
  3. _malcolm

    _malcolm

    Joined:
    Mar 4, 2019
    Posts:
    6
    Awesome, thank you @Runemark ! I was able to move the pistol and can continue now.

    For the error with moving the cameraX/Y with the mouse, all my settings are what you said they should be.

    On a different computer, I opened up the 3D GameKit brand new, using Unity 2018.3.6f1, starting fresh. I went to https://unity3d.com/learn/tutorials/projects/3d-game-kit/making-new-scene and did what it said. Created a new scene, named it, then pressed play. It _immediately_ has this issue, where you can't move the mouse around to change the camera. So I think this is a problem in the tutorial/3D GameKit, not in anything I have done. @Aurore , did something maybe get broken between releases?

    What's broken/missing in the current 3DGameKit that I need to change in my project to re-enable mouse movement?
     
    Runemark likes this.
  4. _malcolm

    _malcolm

    Joined:
    Mar 4, 2019
    Posts:
    6
    @Runemark , I'm happy to say I finished your ranged weapon tutorial! Everything works great, except for my original issue of not being able to move the camera around via the mouse. Makes targeting a challenge LOL. Great work, man. The next step for me is to have the pistol 'hidden' somewhere for the player to find before they can use it. I don't think that will be hard to figure out.

    Anyone else: I still have 2 issues:
    1. Moving (horizontal) platforms I create collide, but the player Ellen does not stay on them. She stays still while the platform moves without her. The ones in the demo game of Level 2 work fine. A chomper ragdoll was thrown on top of my platform and stayed with it. But not Ellen. Ideas?

    2. As described in the previous post above, The 3D Game Kit out of the box does not seem to have working mouse support to move the camera at this time (1.7a released Dec 14, 2018). Moving the mouse does not change the camera. Any ideas on how to fix this? @Aurore ?
     
    Runemark likes this.
  5. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark Hi, thanks for this lesson, but please tell me why when changing from Generic to Humanoid, my character when moving to the W button runs not just straight, but straight with a bias to the right. Sorry for my English, I'm just from Russia
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      72 KB
      Views:
      12
  6. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    121
    Hey! Open the import setting of your animation, and search for the Root Transform Rotation part.
    From the drop-down select either the Body Orientation or Original (one is selected already, you possibly will need the other).
    If this doesn't solve the problem, go back, and play with the value below the dropdown. This is an angle value, that being said, if you set it to 45 it will rotate the animation forward with 45 degrees.
     
    edgarovsepyan likes this.
  7. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    Runemark likes this.
  8. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark Help please, I want to my enemy gone missing as Chomper after death, as this do? and if possible with the same animation
     
  9. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark and one more question, after I disappeared from sight of the enemy, he goes to his initial position, only the animation plays but it does not move.and no sound while running or walking though the enemy did everything in the video
     
  10. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
  11. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    121
    I'll, but not today, sorry. It was a long day for me.
     
    edgarovsepyan likes this.
  12. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark Good. As a free time please help me. I really need to do these things.
     
  13. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark I got it. I found an error why the sound of footsteps was not playing, the whole problem in the animation when I change the animation Chomper, its sound of footsteps disappears, I found an error but how to fix do not know
     
  14. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark I put events now I hear the sound of footsteps but there was one problem. When the enemy loses sight of me goes into its original location, but the problem is that the walking animation is, but he doesn't budge like off NavMesh
     
  15. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
  16. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    121
    Wow, you had a busy weekend.
    Sorry for not answering, but I usually not working on weekends (and checking unity forum is part of my weekday's rutin.

    Usually, it's better to write one post, with all your questions. It's more clear. Right now I'm quite confused about which problem you still have, and which you already solved. Please summarize your current questions in a new post, and I'll try to answer to those.
     
  17. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    my problem is that the enemy after losing sight of me returns to its original position. the problem is that it returns very slowly, I don’t know how to adjust the speed of return.
     
  18. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    121
    Hmm. I'm not sure about it, but if you are using the chomper behavior and the EnemyController scripts for your enemies. Try this:

    EnemyController.cs line 116 (or something like that):
    Code (CSharp):
    1.  m_NavMeshAgent.speed = (m_Animator.deltaPosition / Time.deltaTime).magnitude;
    If you multiply this value let say by 2, it should move faster.
    Code (CSharp):
    1.  m_NavMeshAgent.speed = (m_Animator.deltaPosition / Time.deltaTime).magnitude * 2;
    I didn't test it, so it might not work.
     
  19. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark I did but it didn't help. I uploaded the video to YouTube. Look to better understand my problem
     
  20. Runemark

    Runemark

    Joined:
    May 23, 2013
    Posts:
    121
    Well going back here is not slow, it doesn't work at all. :D My next idea would be, that the walking animation doesn't have root motion.
    Did you add the EnemyControllerStateSetterSMB.cs to your walk animation in the animator?
     
  21. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark Yes I added EnemyControllerStateSetterSMB.cs.it goes fine but here is the return not working
     
  22. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark The problem is, I made it look like a video, and as you can see, he ran after me and he walks. The problem is that when it starts to return to its original position, it stops, and then if it notices me and stops, you've seen it on video. What can I do he back to his original position?
     
  23. edgarovsepyan

    edgarovsepyan

    Joined:
    Feb 24, 2019
    Posts:
    14
    @Runemark all I solved this problem just changed the script EnemyControllerStateSetterSMB.cs the script which found on the Internet EnemyControllerStateSetterSMB.cs