Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Third Person Controller - Third Person, AI, Multiplayer, Mobile Framework

Discussion in 'Assets and Asset Store' started by opsive, Jan 21, 2015.

Thread Status:
Not open for further replies.
  1. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Found another strange one: jumping while going up an incline or stairs sometimes results in flying.
     
  2. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    I haven't tested it with a UMA character but during runtime the controller doesn't know that it came from UMA so make sure you have added the same two components as what is in the demo scene.Those components are the InventoryPlayer and InventoryControllerBridge. InventoryControllerBridge.SetActive should be called when you open up the inventory menu.
     
  3. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    That sounds like a fun one :) I just tried it on the clean scene stairs but wasn't able to reproduce it - have you noticed a specific timing of it doing it relative to the stair location when you press the jump button?
     
  4. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    No, it happens so infrequently that I'm never able to do it intentionally. It's only happened a handful of times. I'll do a few tests on the clean scene and see what I can figure out.
     
  5. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    Purchased this yesterday, and I'm hoping to be able to check it out tomorrow evening and over the weekend (other real life hobbies take precedent tonight :D lol)
     
    TheLetterS and opsive like this.
  6. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    Hi, I have playmaker now, along with behavior designer and third person controller. I plan on setting up the demo ai scene again but before I do I wanted to know if playmaker should be installed with the integration package for BD or TPC or both? Also, even though I was the guinea pig and spearheaded the control freak integration I have started using Incontrol instead.CF simply uses to many draw calls and hasn't been updating. So my question is with playmaker installed with integrations for Incontrol, InC should be compatible with TPC and BD correct? Or is there to much going on?
     
  7. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    You can have both the Playmaker and Behavior Designer integration packages installed without a problem. There is no InControl integration yet but I do plan on adding one.
     
  8. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    Version 1.2.1 has been sent to opsive.com purchases and is now on the Asset Store. You can see the release notes within this post. This version is more a minor improvements/bugfixes release. There is a new ability included which is really useful for the 2.5D mode though.
     
  9. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    So it wasn't just me? Or is this just a placebo? ;)
     
    Last edited: Jan 23, 2016
  10. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    I copied those release notes from my repository commits and forgot about it when you mentioned it a couple of days ago. Maybe that's why I couldn't reproduce it :) Hopefully it'll fix the one that you hit!
     
    drewradley likes this.
  11. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Do we need to do anything special to upgrade?
     
  12. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    If you are using the Behavior Designer integration then the Movement and Formation Pack integrations are no longer necessary but besides that it should be a smooth upgrade. No fields were deprecated and this was mostly just a minor release.
     
    drewradley likes this.
  13. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    One more: are the codes updated now as well?
     
  14. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    Yes - with the added option in that you can select the version that you want to download.
     
    drewradley likes this.
  15. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    What's the best way to change the collider height on a roll? Thanks!
     
  16. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    You can set the Collider Curve Data on your animation

    curve.PNG
     
  17. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    This won't conflict with anything in your scripts?
     
  18. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    No - the scripts will actually use that value to adjust the collider.
     
    drewradley likes this.
  19. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I am using a looping recoil animation for fully auto weapons (so it keeps playing while firing) and when the gun is empty and the fire button is still down, it keeps playing. What's the best way to prevent this within your system? Thanks!
     
  20. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Can someone please explain how Items and specifically Assign To in the item builder works? If my Character is generated at runtime, or in the case of multiplayer you don't know ahead of time who the item will be assigned to. Can someone clear up how this works, specifically in the case of UMA for example.
     
  21. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    Just so I'm following along, this is something that you've added, correct? The Item.StopUse method will be called when the item stops firing because it's out of ammo. This method will then call the AnimatorMonitor's DetermineStates and it is here that you'll want to ensure you are playing the correct animation based on the current item state.
     
  22. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    If you look at ItemBuilder.BuildOrAssignItem you can see everything that the "Assign To" button does. There aren't any editor calls (well, besides EditorUtility.DisplayDialog for errors but that can easily be changed to Debug.LogError) so you should be able to have similar functionality with UMA. Basically what you'll want to do is search for the ItemPlacement component and then add the item as a child of the GameObject with that component.
     
  23. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Sorry, I meant the attack animation. I called it recoil since that is really what it is. :) I didn't make any changes (this time) to it and simply set the animation clip to loop.
     
  24. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    After looking into it it looks like all of the full auto ShootableWeapons should be set to a looping attack animation. The Used callback wasn't being fired because the animation was only running once. You do need to make a small change within ShootableWeapon.Used to account for this change. Replace the entire method with the following:

    Code (csharp):
    1.  
    2.   if (m_FireType == FireType.Instant || m_Inventory.GetItemCount(m_ItemType) == 0) {
    3.     StopFiring(true);
    4.   } else {
    5.     m_ReadyToFire = true;
    6.     if (m_FireType == FireType.ChargeAndFire) {
    7.       DoFire();
    8.     }
    9.   }
    10.  
     
    drewradley likes this.
  25. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Works great!
    Thanks!
     
  26. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    In Adventure mode, autofire stops when the mouse moves. Is that intentional?
     
  27. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    It probably has something to do with the Item Use Rotation Threshold. Try to increase this value.

    (from here)
     
  28. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    That did it. Thanks!
     
  29. redjon29

    redjon29

    Joined:
    Jul 12, 2015
    Posts:
    92
    Hi, I'm trying to replace the lower body animation state while the character has a weapon equipped I've copy-paste the movement blend tree and renamed it movement Rifle and replaced animation. Then in the weapon inspector i've wrote movement rifle in the lower state but he keeps playing the normal movement animation. Do I've missed something?
     
  30. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    It looks like the item's lower body state isn't being called for the item's idle and movement. I'll send you a PM with the fixed file.
     
    Last edited: Jan 26, 2016
    redjon29 likes this.
  31. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Me too please.
     
  32. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Would it be possible to get an empty version of the weapon wheel? I've been taking the blank one and rotating it to make new ones but getting the master from you would save me some time. Thanks!
     
  33. TheLetterS

    TheLetterS

    Joined:
    Jan 22, 2013
    Posts:
    31
    I just sent you a PM with a link to download it, hope that helps! :)

    Sarah
     
    drewradley likes this.
  34. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    That's perfect! Thanks so much!
     
    TheLetterS likes this.
  35. redjon29

    redjon29

    Joined:
    Jul 12, 2015
    Posts:
    92
    Thanks it works well!!! So cool it looks more human GREAT
     
  36. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    When in Adventure mode and facing away from the direction to aim, the player often contorts horribly before it finishes the turn to aim. I suspect it's got to do with the IK turning on before it finishes turning. Is there any way to set it so the IK only starts when the player is mostly facing the aim direction - should that be the issue?
     
  37. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    The first step would be to disable CharacterIK and see if that helps. If it doesn't help then it's something else. If it is IK you can then adjust the Look At Body Weight for both the normal and aim state.
     
  38. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Yes, turning off the IK script does stop it. Setting the Body Aim Look Weight to 0 removes the body contortions but the arms still go all screwy, often passing through the body as the body turns, so the gun aims before the body finishes turning.
     
  39. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    You'll probably also want to play with the IK adjustment speed to fit your rotation speed and aim animations. The CharacterIK component uses Animator.SetLookAtPosition and Animator.SetLookAtWeight so these parameters correspond to the Unity parameters.
     
  40. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    None of those things work as well as simply turning on and off the script. Is there any problem just doing that? I can easily write a simple script to do that.
     
  41. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    No problem at all - IK is not required for the controller to work.
     
    drewradley likes this.
  42. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Excellent.
     
  43. redjon29

    redjon29

    Joined:
    Jul 12, 2015
    Posts:
    92
    Hello someone knows how keeping my character when i change scènes? I want to keep my inventory, health and position. Ex when I enter a trigger in front of a door the scene switch to another with the inside of the building and when i go out - trigger and the player is outside in front of the building
     
  44. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    Have you tried using DontDestroyOnLoad?
     
  45. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    What's the best way to delay the projectile instantiate? I would like it to fire off when the "ItemUsed" function is called from the attack animation. Is there a delay somewhere I'm missing or is it hard coded to instantiate right when I fire? When I set it to charge and fire, it fires when I want, but it fires multiple shots at once.
     
  46. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    ChargeAndFire should work for delaying the firing until the used event is called. I just tested it on the rocket launcher within the shooter scene and it only fired one shot with that setting. Can you compare your item to the rocket launcher to see what is different?
     
  47. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I'm using the rocket launcher. I think I know what it is though. I have my attack animation on two layers so perhaps it's being called twice?
     
  48. opsive

    opsive

    Joined:
    Mar 15, 2010
    Posts:
    5,130
    That is probably it - you could duplicate your attack animation and then only add the event to one of the animations.
     
  49. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    That's what I just did. Works fine now. Have to remember that.
     
  50. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Another question. I'm using the clean scene player as my template but that controller starts in run and walks when the sprint button is pressed. How do I switch that so it starts in walk and runs when pressed? I looked everywhere I could think of to change that but couldn't find it. Probably someplace obvious that I overlooked.
     
Thread Status:
Not open for further replies.