Search Unity

[RELEASED] TPSA - Third Person Shooter System (template)

Discussion in 'Assets and Asset Store' started by Stiffx, Jan 24, 2015.

?

What additional pack would you like to see in TPSA?

Poll closed Apr 1, 2015.
  1. Enemy AI Shooter

    44.4%
  2. Friend AI (like sherry from Resident evil 4)

    55.6%
  1. Skarabx

    Skarabx

    Joined:
    Mar 3, 2015
    Posts:
    6
    Thanks Stiffx! No need to apologize about the Zombie. :) It is after all... a zombie.
     
    Stiffx likes this.
  2. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Hi there guys,

    Following the last tutorial here goes the second part of the basic setup. Now let's setup a weapon from scratch.
     
    Last edited: Mar 21, 2015
    Skarabx likes this.
  3. daeuk

    daeuk

    Joined:
    Mar 3, 2013
    Posts:
    67
    anyone tried this with UMA? i plan to buy this and use it with UMA.
     
  4. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Hi there @daeuk I dont know UMA very well, but as long as it uses a 3d model with humanoid skeleton and is capable of running mecanim everything should work just fine.
     
  5. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    I have a question about the Asset :
    Can the character cover on non plane surfaces ? like a wall with multiple columns on it , os it is not something plane : how will slide the character ?
    Can the character cover behind any objects in front of him ? Cars, bike, trunk, train, wall debris ?
    Or can we specify objects that should be used as cover instead ?

    When we cover the camera is placed on the right looking at the character, can that be changed ?
    I would need the camera to behave like others TPS : when you cover the camera looks forward in front of the cover to what is going on.
     
  6. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Will you add shooting enemies? That would be fecking awesome
     
  7. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Hi there @zenGarden and @Devision4 , thank you for passing by. :)

    As long as there's no objects by players side it should work, I mean, if there's two columns one at left and one at right the player can't move because of the collider.

    Yes indeed. Different from the Jump and StepOver events the cover just performs a small check with raycast. There's no limitation to cover as long as the raycast says it's fine to cover.

    This would be a nice thing to do, but for now the cover runs wild and free :D

    This is a very nice idea I might add it in the future, hadn't thought about it so far. Thanks
     
  8. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    This would be good for people to have a complete ready to go TPS system with basic ennemy AI.


    How does it works ? you press a button to cover in front of some obstacle or it is auto ?
    Do you press the same button to quit the cover or does it quit automatically when you are no more covered when you move ?
     
  9. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    You need to press a button to cover, here is how it works:
    Press X in front of a object then cover starts.
    Press C to enter/exit crouch in cover.
    Press DOWN to exit, but if you reach cover left/right limit you can press UP to exit walking forward.
     
    jayimagination and zenGarden like this.
  10. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    New update,
    Now you can rotate the camera around the player and as soon as you start moving the character will rotate towards the camera direction. I hope you guys like it
     
    Last edited: Mar 24, 2015
    AgathaCrup likes this.
  11. AgathaCrup

    AgathaCrup

    Joined:
    Jun 20, 2013
    Posts:
    27
    Great update Staffix
     
    Stiffx likes this.
  12. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you @AgathaCrup
     
  13. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Another update.

    Now you can push objects :D:p


    The gizmo shows where each hand should be positioned when push starts.

     
    Last edited: Mar 24, 2015
  14. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Nice! Is this all going to be in the final Unity 4 release?
     
  15. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    The push object yes, the rest no, because I'm starting to take advantage of the unity pro (now free in personal) features.
    There's a section in checkPush method exclusive to unity 4
     
  16. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    I'm sorry I forgot that the new camera will also be present in unity 4. :p
     
  17. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I should just suck it up and upgrade. :) But since I have 4 pro and don't have 5 pro it still feels like a downgrade even though it's not really.
     
    Stiffx likes this.
  18. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    I understand, it's really frustrating, but the things we can do with unity 5 now is almost limitless. I really like that. But I suggest you at least use the unity 5 editor in a separated folder so you can download the new updates and maybe reproduce the code at version 4. Anyways please don't go away haha :D stay around and if you can upgrade to unity 5:p
     
  19. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Yeah, I'll upgrade to five and start fresh with the next update you release since I am not allowed to upgrade any current projects from Pro to Free.
     
  20. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    OK guys the update is ready. For unity 4 this is the last update, for unity 5 there's still new updates to come.
    The Code Only option is disabled because it's obsolete right now.

    www.stiffix.info

    Cheers
     
  21. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    @Skarabx about the zombie I'm still working on it, the problem seems to be the distance calculation to attack. Anyways I did not upload the fix cause I'm making it better, so wait for me...

    Thanks
     
    Skarabx likes this.
  22. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Hi, I just purchased your asset finally :) Iam missing the inventory and some other features. Are they not yet updated on the asset store?
     
    Stiffx likes this.
  23. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Thank you for your purchase @Devision4 the inventory and other updates you can download from here www.stiffix.info I'm maintaining a server for you guys to download updates faster cause unity takes like forever to upgrade the pack.

    Cheers and welcome on board, have fun
     
  24. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    awesome thanks :)
     
    Stiffx likes this.
  25. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    Great asset. One feature I might wish :) Some visual notification system when a item is in pickup range. Like a glow around the object and a text display what item it is, before I pick it up. otherwise awesome stuff. Oh and zoom out of camera would be nice .D
     
    Stiffx likes this.
  26. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Consider it done! :)

    Hmm let me think about it, because I think it might break my camera pivot.
     
  27. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    maybe 2 cameras, one like now and one more in distance and switchable via keyboard key?
     
    Stiffx likes this.
  28. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Ok guys, the next updates for TPSA will be Swim and climb ladders, but I also what to know what do you guys think about additions. Please answer the thread poll if you can.

    Thank you all
     
    Last edited: Mar 25, 2015
  29. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    How do I make the push object actually move? All that seems to happen is he stands there shoving against it and it doesn't move. I had better luck moving it by just walking into it on a side with no push components.

    p.s. Updated to five and really like the way he looks around when you move the camera. Still can't get my own "aim" animations to work properly - still can't make him bend, even following the instructions you gave me and I am totally baffled by it. I guess that's okay; I can use the grenade toss as a spell cast. Has a nicer visual anyway with the trajectory line.
     
  30. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    That's really strange because it's the same logic as moving by walking except that the rotation is locked to the object and the IK is taking care of the hands. Other than that is just a rigidbody pushing another rigidbody. Ahhhhhhh how much mass your character rigidbody has? Change it to 3 or more, you need weight to push a heavier object.

    haha that's nice, but give it a couple of days and you'll find a way to do that (always happen to me)
     
  31. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Got it! Thanks! Had to put the mass of my character WAY up and the mass of the object way down. But it still pushes much better when I just walk into the object. Perhaps I'll edit the script to disable the rigid body unless the character is pushing.
     
    Stiffx likes this.
  32. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    That's a nice approach
     
    drewradley likes this.
  33. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    And it works nicely. I just turn the kinematics on and off depending on push state.

    I'm noticing that since my character is a little less than half the size of yours, I need to edit little things like the distance to a corner when in cover otherwise he stops way short of the corner and looks through it instead of around the corner. Are there many places that have hard coded numbers that depend on the size of the character?
     
  34. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    When I created the code for cover, I was not thinking of size, but I was thinking of distance from the objects. Anyways I believe the only place size matters is for jump over and step over (but you know it uses character scale to calculate the jump height, no need to hard code that part).
     
    drewradley likes this.
  35. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I still need to edit the wall jump height otherwise my character ends up floating or just plain can't get up. I basically half all your settings as needed and that seems top fix all the little problems.

    What is cover position Y used for? I haven't yet looked so perhaps you can save me time and let me know if I need to change that as well. Trial and error isn't always the best way to go with things like that as it may look like its working but eventually something horrible goes wrong and you've no idea what. :)
     
  36. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Can you be more specific? witch line of TPSA_PlayerController?
     
  37. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Around 923 in LimitCoverMovement().
     
  38. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    ok, this is the origin from my Ray to start Raycast against the cover object. It will start from a certain position to another position to see if there's still a object in front left/right of the player, basically is to check if you are in the end of the cover object. Anyways answering your question this is the Vector3 origin position from my Ray to check object in front (or at players back).
     
  39. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    It's more or less like this:

     
  40. daeuk

    daeuk

    Joined:
    Mar 3, 2013
    Posts:
    67
    prone animations would be great... shooting from prone, etc
    stealth kills would be great as well
     
  41. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Thanks! It sounds like I need to adjust that float as well.
     
  42. silentking

    silentking

    Joined:
    Mar 6, 2015
    Posts:
    14
    Is there a way to have the ai character get knocked back when shot, even slightly?

    Can it be done by having the bullet manipulate the position of the enemy?

    A patrol path and a shooting enemy would be fantastic additions along with the climb and swim.

    really appreciate the constant upgrades, you're a legend!
     
  43. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Yes indeed. At the method ReceiveDamage(TPSA_Damage dmg);
    Code (csharp):
    1.  
    2. Vector3 dir = -dmg.ray.direction;
    3.  AIRigidBody.AddForce(AIRigidBody.velocity * Time.deltaTime - dir * dmg.Power, ForceMode.Impulse);
    4.  
    I did not test the above code, my only concern is that the navmesh is taking care of the rigidbody so it might not let you move with this code, it might require a workaround.

    You are very kind i can't even thank you enough.
     
  44. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    I'd like to have a shotgun (spread shot). Is that something I'd need to code myself or is there some way to do it as it is? Is that what "bullets per shot" is for in the weapon configuration?
     
  45. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    No need to code, just change the Bullets per shot. It will hopefully loop through all the bullets and use the accuracy to calculate each bullet rotation and position.
     
    Last edited: Mar 26, 2015
    drewradley likes this.
  46. Skarabx

    Skarabx

    Joined:
    Mar 3, 2015
    Posts:
    6
    Thank you sir! No worries at all!
     
    Stiffx likes this.
  47. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    Found another issue related to the size of my character: when he slides, the camera drops beneath the floor. I fixed it by changing the PCamera lookat y pos from 2.5 to 1.25 around line 1212 and 1225 in the playercontroller. Perhaps the next release you can add some public variables to let us adjust these settings without going into the code? So far, I've needed to edit the code for the wall jump height (needed double what you have to get up the wall!), the distance to the corner when in cover, and the slide camera adjustments.

    Thanks!
     
  48. Stiffx

    Stiffx

    Joined:
    Oct 27, 2014
    Posts:
    455
    Sure ;)
     
    drewradley likes this.
  49. AgathaCrup

    AgathaCrup

    Joined:
    Jun 20, 2013
    Posts:
    27
    Hey Staffix, I cant believe how rapid and regular you're updating this asset, the changes this week alone are fantastic. I saw you say earlier in the thread that you were inviting input, well here goes, the most obvious would be that you have a shooter NPC I noticed that your asset was number five in the best sellers list on the asset store (congrats) If that didn't get your asset to number 1 in a week I'd buy it again as a bet :)

    I'd like to be able to

    1 drop items that could be used as mines etc etc for my game :)
    2 laser guided missile, using some sort of hand held tool you can call a massive airstrike and take out a whole block.
    3 and how bout a drone that allows you to scout ahead from cover...maybe even highlighting enemy positions.

    Now this would be a real stretch and probably more a bolt on than an update (and I got my credit card ready either way) but how cool would it be to be able to have 3 team members that you could control...placing them in strategic positions, say 2 snipers and a heavy weapons character creating cool strategic game play.

    Any way, just about to re launch my website in html5 and waiting for a few updates to work on unity5 before re-building my first game level so fingers crossed you keep shocking us all with the turn around of ideas and updates, I'll defo be buying any thing else you make.
    Bless
     
    Last edited: Mar 28, 2015
    Stiffx likes this.
  50. superwendel

    superwendel

    Joined:
    Jun 18, 2013
    Posts:
    105
    Why are all of your links AOL webmail links?