Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

UFPS : Ultimate FPS [ RELEASED ]

Discussion in 'Assets and Asset Store' started by VisionPunk, Mar 9, 2012.

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

    superjayman

    Joined:
    May 31, 2013
    Posts:
    171
    There seems to be major problem with parenting objects to Camera&Controller. They do not show up!!.. I'm trying out the SimplePlayer prefab. All is good if you parent an object to the FPSCamera but not if I parent it to Camera&Controller. It simply does not work, what could be going wrong?
     
  2. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey guys, I've gotten several questions about how to run UFPS with the Rift, so here goes:

    Getting Oculus Rift set up with UFPS is actually very simple:
    1. Import the "OculusUnityIntegration.unitypackage" into your project.
    2. From the top "Oculus --> Prefabs" menu, add an OVRCameraController to your scene (we won't be needing the OVRPlayerController).
    3. Add an empty gameobject, and rename it "ForwardDirection".
    4. On your UFPS player hierarchy, disable the WeaponCamera (if any).
    5. Add the "OVRCameraController" and "ForwardDirection" objects as children to the FPSCamera object (see image).
    6. Make sure that the "ForwardDirection" transform points in the same way as the FPSController object, basically its Position and Rotation should be all zero.
    7. Select the "OVRCameraController" and drag your root player object ("AdvancedDemoPlayer" in the below picture) to the "Follow Orientation" slot of the OVRCameraController.
    $oculusHierarchy.jpg

    That's it! All camera shakes and motions will affect your Rift "head" properly by default. WASD is still used to control the character. The mouse will rotate the player body and pitch the weapon.

    $RiftKaBoom.jpg

    Things to look into:
    • You may want to rethink your mouse settings. I recommend reducing mouse sensitivity a lot, activating mouse acceleration and adding a little extra mouse smoothing. It should feel like a human body, not a Quake speedrun =).
    • Our Retraction feature is perfect for VR! The downside of not being able to control weapon perspective no longer applies. Be sure to tweak it nicely for all your weapons. As an example, I set Retraction for the machinegun to 1.225 which worked well in my setup.
    • If your game does not use a local player body mesh, your weapons will be carried around by floating arms! This is something we will address in a not very far away update.
    • The cursor and GUI messages will be rendered in the middle (and thus off) of the screen. This can be solved easily in vp_SimpleHUD by drawing these things twice, once for each half of the screen.
    Ofcourse there are plenty of other things to look into (additional input options, for one). We will be extending Rift support in our upcoming versions. It will be the best there is, you can be sure of that! =)


    Edit: Added missing Step #7 to the tutorial.

    Edit: For more UFPS and Rift fun check out this video:



    This is a very quick test we conducted as part of the Ultimate FPS Rift integration. This should be awesome with additional bone influence falloff and some other cool tweaks we have in mind. Just imagine this in multiplayer. You could be communicating using actual body language!
     
    Last edited: Jul 28, 2013
  3. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,002
    Thanks so much!!!! Looks so simple!! Does the SDK handle drawing the 2 sets of images for you?
     
  4. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    This sounds very strange. Would you mind explaining a little bit how your enemy is set up? I'm trying to figure out if there could be any shared code that disables the enemy colliders in some way.. hmm
     
  5. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    This occurs because objects under the player hierarchy will automatically get the layer "LocalPlayer" which makes them not render. A quick way to fix this is to mod the Awake method of vp_FPCamera like so:

    Code (csharp):
    1.  
    2. // set parent gameobject layer to 'LocalPlayer', so camera can exclude it
    3. Parent.gameObject.layer = vp_Layer.LocalPlayer;
    4. foreach (Transform b in Parent)
    5. {
    6.     if(b.name != "NameOfYourObject")    // <- insert this line
    7.         b.gameObject.layer = vp_Layer.LocalPlayer;
    8. }
    9.  
     
  6. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi yung,

    Real quick, you might find this helpful:
    http://bit.ly/1aJIuqD

    And also, note that if you inherit an FP class, you typically have to inherit its editor class aswell (found in the corresponding Editor folder).
     
  7. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Yeah, that's all automated by the Rift SDK. They have actually made a great job of making everything "just work".
     
  8. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    BrandSpankingNew and VisionPunk : Thanks for the tips and links, I think it's time for me to refactor and redo stuffs!!
     
  9. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Hey! All I EVER give you is "strange"! :D

    I was in error when I said that my robot falls through the terrain...sort of. I have found, through more careful observation, that what he really does is translate instantly to large Z and X values which are greater than the bounds of my terrain. He also climbs quite quickly to a Y value of about 900 and then begins to fall rapidly to negative Y, forever. The X and Z also continue to climb. I believe that if he were not so far out of bounds that he would NOT go negative Y. But, it's still a bad deal, no? So, I guess I don't really have a "falling through the terrain problem", but rather a "goes out of town instantly" problem. Thanks for your help. Don't stay up late working on this, but if you think of what's wrong, I'll be in your debt, as usual.

    Anyhow, the setup of my bot is thus: The Parent is an empty GameObject containing Audio Source,Vp_Shooter, Vp_Damage Handler, Vp_SimpleAITurret, Box Collider, Rigidbody and my MechAI script to drag him around chasing me. The Child is a stock Mine_Bot from the AngryBots example program. He is that little spider-type one that used to scamper up to the player and explode in that demonstration project. He has graduated up to machine guns these days. The only animation that I am using is the Forward.
    edit:
    I have tested with both the Advanced and the Standard player. Also, the X and Z values can be very large in both positive and negative directions initially. I detect no pattern other than a tendency toward positive Y values at the moment of liftoff. Naturally, because I have gravity turned on, everything eventually goes negative.
     
    Last edited: Jul 5, 2013
  10. rkruk

    rkruk

    Joined:
    Dec 19, 2012
    Posts:
    6
    Is there a way to back the camera away from the hands to show the back of a character for example like in ravensword type of game, trying to figure this one out. thanks
     
  11. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    171
    Thanks for the reply, OK it shows up now, BUT!, there is still a problem with parenting an object to Camera&Controller. The object drops somewhere near the ground and when I move around its very jumpy and jittery. It does not maintain the initial transform its suppose to have. The jitter is more of a concern. Please this this out yourself, very easy to test. Again, if I parent my object to FPSCamera, its all good and solid no jitter, but thats not what I want.. I want to parent my object to Camera&Controller so that it does not get effected with Vertical motion of mouselook. Cheers..
     
  12. junkyardog

    junkyardog

    Joined:
    Feb 20, 2009
    Posts:
    92
    Just picked up UFPS (the screen shots of the commented source sold it). Is the

    " UFPS is now in the process of transitioning from a camera-and-controller focused asset into a full, modular FPS game platform"

    concept discussed somewhere?
     
  13. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    Managed to figure out how extend the vp_FPController class and now I seems to hit another wall. I am creating a lot of custom Activity and it seems right now, my idea of extending vp_PlayerEventHandler is not quite working as it seems the extended vp_FPControllerEX is still looking for the original eventhandler.

    Could anyone give some pointers on this?
    Would I have to hardcode it into the originals? It's not much work but I just kinda dislike having to do that everytime there's an update.

    Edit:

    Seems to be facing another issue.

    The extended FPController is giving this issue.

    vp_FPController.Player' is inaccessible due to its protection level.

    I googled and it seems its because this is set to private/protected therefore it's not accessible, but after checking FPController and vp_Component, there is no such declare anywhere.
     
    Last edited: Jul 6, 2013
  14. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    I had tried to do some similar things, and ended up setting "Player" to protected in most of the classes were it's private, and ended up modifying vp_PlayerEventHandler directly rather than try to subclass it. Subclassing worked well for vp_FPInput, Weapon, Camera, and a few others, but for vp_PlayerEventHandler i gave up and decided it would be easier to directly modify it, and just back it up before I update UFPS.
     
  15. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    That's unfortunate but I guess the simpler the better. I was thinking of trying to extend the classes and update UFPS since the latest Interact and Ladder climb and also footstep, but I guess I would have to follow your way. Thanks makeshiftwings!

    If anyone is willing to share some advice on how to do it properly, I am all ears! Thanks in advance
     
  16. Daniel DBA

    Daniel DBA

    Joined:
    Jun 11, 2013
    Posts:
    16
    Need some help with fall damange...

    I want to have fall damage enabled but I have noticed some odd behavior. When the AdvancedPlayer is standing on top of a ragdoll and then falls off onto the ground (3 inches or so), the player takes massive fall damage and dies. I'm talking 9000% health to dead, from a 3" drop. This doesnt happen every single time but it is easily repeatable if you are on a ragdoll and then walk off of it. The player does NOT take massive damage if falling a few feet.

    Any thoughts?


    Thanks!
     
  17. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    I got one bad ass video on the way!!

    $ai_preview.jpg
     
  18. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274


    Video of my prototype. Multiplayer FPS focusing on maneuverability. Player can DoubleJump, Wallrun, climb ledge, ground slide, and later, dodging with boosters! Added multiplayer based on FPS kit.

    It's a bit choppy video, still learning how to do screen recording. Will upload a smoother one
     
    Last edited: Jul 7, 2013
  19. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207

    This is interesting,

    I know this has nothing to do with architecture, but for me Events and “GetComponent” work wonders. I keep it this way and it allows me to be worry free about updates.

    However I am mostly working with general data of the player, such as position, rotation, health, weapon in hand, ammo count, e.t.c

    There is always little modifications but nothing that can’t be easily added to an update. And mostly for personal preference.

    For example I like the health to be none % based, and the reload keeps the dam bullets!! LOL
     
  20. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Dude that is sweet, its exactly like the concept! When can I play!!!!
     
  21. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    Thanks! Hopefully very soon! Right now the wallrun is very very buggy, and only works on specific tagged objects. I wanna make it more dynamic first and make it more consistent. I would also love to add a boost dodging mechanic, kinda like hawken's shift dodge. Once this two is tested out, I am gonna make a demo build for testing.
     
  22. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    That’s one dame fine concept, I see what you did and I had no idea that was possible!!
    You must have worked none stop on that?
     
  23. Daniel DBA

    Daniel DBA

    Joined:
    Jun 11, 2013
    Posts:
    16
    That's gonna be SUPER Bad Ass, with those zombies!
     
  24. superjayman

    superjayman

    Joined:
    May 31, 2013
    Posts:
    171
    I was hoping for an answer for this? Thanks
     
  25. Jaysta

    Jaysta

    Joined:
    Mar 13, 2013
    Posts:
    141
    Hi bubba, I added your code to vp_FPSCamera within the UpdateMouseLook but I get 4 errors stating that:

    sensitivityX does not exist in the current context.
    sensitivityY does not exist in the current context.
    invertX does not exist in the current context.
    invertY does not exist in the current context.

    Am I missing something?

    Thank.
     
  26. Indie-developer

    Indie-developer

    Joined:
    Jul 7, 2013
    Posts:
    18
    OK Visionpunk I just have to say this is asset is a steal at the price, epic work! but I have one quick question which may or may not be easy to answer. How would I go about changing the weapon pickup system to where the player has to press a key, for example Press "E" to pickup a weapon instead of having a collision based system I've looked through these forum posts and for the life of me I cant figure out how to do it iv'e looked at the event system and the inventory manager but i'm mind stumped on how I would do this! :D and again thanks for the awesome asset pack.

    edit - I know that there is the interaction with picking up and throwing objects which I thought I could adapt that system to where I could do what I want but i'm still unsure :)
     
    Last edited: Jul 7, 2013
  27. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    I think that the Q and E keys are occupied for scrolling weapons.
     
  28. Indie-developer

    Indie-developer

    Joined:
    Jul 7, 2013
    Posts:
    18
    It doesnt have to be q or e it can be F also it shouldn't matter what key it is im sure it can be done just not sure how :(
     
  29. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    Take a look at the interaction script and the action script, Im sure you can find a way to use the interaction script to activate an item in your inventory. Try this, Set up your item with a pickup script but also add an switch script to it then set te target to be the same gameobject and set the message to "TryGive" not sure if this works but worth trying.
     
    Last edited: Jul 7, 2013
  30. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    Does anybody know how to make an RPG or rocket launcher? Since it uses bullet drop and the projectile has a physical presence, I can't figure it out.

    Also, using the same methods, how could you make a frag grenade or something you throw down?

    Thx,
    -DevFo
     
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,002
  32. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    Set a rocket model as the bullet with a constant velocity script.
     
  33. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    I have managed to figure out the messaging system. But still i have some problems with it, I made a light using this script and it worked pretty well. But when i tried to convert it to a door which uses animations. The door keeps looping the opening or closing animation. Even when i change the wrap mode to once it won't work. Here's the code:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class OpenDoors : MonoBehaviour {
    5.    
    6.     public bool Toggled = false;
    7.    
    8. void Toggle() {
    9. Toggled = !Toggled;
    10.     }
    11.    
    12.         void Update() {
    13.         if (Toggled == true)
    14.             animation.Play("DoorOpen");
    15.        
    16.         else
    17.             animation.Play("DoorClose");
    18.    
    19.     }
    20. }
    21.  
    I think its due to the boolean being allways true so the door keeps repeating it's opening animation. I just can't find a more efficient way to do this. Can someone help me please?
     
  34. Andy2222

    Andy2222

    Joined:
    Nov 4, 2009
    Posts:
    81
    Short feedback regarding the CustomEditors in this package. Could u flag those as "editorForChildClasses", since i needed to override the "vp_FootstepManager" to add extra Ai functionality, so our Ai can "hear" footsteps. I could not find any delegate/event callback to hook me directly into the Footstep()/PlaySound() calls, so extending was my only option. Unfortunately this also breaks the Editor part of this component, which is kinda essential for correct setup.

    So if u can change those editors to "editorForChildClasses" this would help, since editing org. packages is always a bad practice.


    Thx Andy
     
    Last edited: Jul 8, 2013
  35. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    The thing is, that you'll need to be able to open and close the door manually. Each time the player activates the door it will toggle between true and false so that when it has played the open animation it keeps open and can be closed again by re activating the door.
     
  36. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    I had no idea that was a thing! That will make my life much easier.
     
  37. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    Thank you for your help! Also, does anyone know how to reload once for each bullet lost? Such as a shotgun how the reload time varies upon the amount of bullets left?
     
  38. TheStone

    TheStone

    Joined:
    May 18, 2013
    Posts:
    77
    I been trying to figure couple of things out, but no luck... I have send few emails to support, but no response... I am fearly new to developing with unity, I like it a lot.

    I really love this package, it is amazing!!!

    I CANT figure out how to implement animations with the package, I downloaded some skeleton 3D models with animation, and practice shooting the at them, I can figure out how to animate them and how to change the animation when it dies, or health is 0, I has assigned the vp_PlayerDamageHandler script the squeleton, and I see that the health points go to 0, but nothing else happen...

    The way I know how it works is when something enters in the collision mesh and then you can subtract points to the GameObject...

    protected void OnCollisionEnter(Collision collision)
    {

    ApplyDamage(10);

    }

    public void ApplyDamage(float damage)
    {

    health -= damage;

    //animation.CrossFade(hitAnimation);
    if (hitAnimation != "")
    {
    animation.CrossFadeQueued(hitAnimation, 0.1f, QueueMode.PlayNow);
    }

    }

    But with this control he never calls the capsule collider, when I shoot at the skeleton, nothing is calling the collider... even I see wholes in the mesh...

    I dont know what to do, to play the different animations, and cause damage to the enemies, can someone help me.

    Thanks very much in advance for the person/s that take the time explaning me this :D
     
  39. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    How is this supposed to receive a message from the Vp_Switch?
     
  40. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    I have completely misunderstood what you have been asking. I thought that you were having a problem with your animation looping, not messaging. I was trying to provide an example that you could modify, with very little effort, that would solve that animation problem. Sorry. Good luck.
     
  41. Sashimi_2

    Sashimi_2

    Joined:
    Jun 26, 2013
    Posts:
    30
    Maby a dumb question, but anyway here we go....

    Does anyone else have problems with any kind of lensflare and the ufps asset?
    A normal cam works fine, but as soon as I use ufps..no flare at all.

    How do I get It to work? Ideas?
     
  42. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Perhaps component/rendering/flare layer? I mean, select the camera and add the flare layer.
     
    Last edited: Jul 9, 2013
  43. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    Had a doctors appointment, didn't mean to leave you hanging. :cool:

    Code (csharp):
    1.  
    2.  
    3. using UnityEngine;
    4. using System.Collections;
    5.  
    6. public class ExampleFromSwitch : MonoBehaviour {
    7.  
    8. private bool trigger1 = false;
    9. private bool trigger2 = true;  
    10.    
    11.    
    12.     // Use this for initialization
    13.     void Start ()
    14.     {
    15.  
    16.        
    17.     }
    18.    
    19.     // Update is called once per frame
    20.     void Update ()
    21.     {
    22.    
    23.    
    24.     }
    25.    
    26.    
    27.       void GotMessageFromSwitch()
    28.     {
    29.     trigger1 = !trigger1;
    30.        
    31.     if ((trigger1)  (trigger2))
    32.         {
    33.             Debug.Log("DoorOpen");
    34.             trigger2 = false;
    35.             return;
    36.         }
    37.         else if ((!trigger1)  (!trigger2))
    38.         {
    39.             Debug.Log("DoorClose");
    40.             trigger2 = true;
    41.            
    42.         }      
    43.     }
    44. }
    45.  
    Assign a Target .. the thing that has this script attached to it, and set the Target Message = GotMessageFromSwitch.
     
    Last edited: Jul 9, 2013
  44. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    By default the player has no flare layer or it's disabled. Take a look at the camera Gameobject.
     
  45. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,514
    Anyone know how to get SSAO to work?
     
  46. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    Thanks man, This helps me alot.
     
  47. Sashimi_2

    Sashimi_2

    Joined:
    Jun 26, 2013
    Posts:
    30
    I was kinda sure there was a easy solution out there :)

    Thanks for pointing that out.
    Thx to J-C as well

    Cheers,
    ....
     
  48. devfo

    devfo

    Joined:
    Jul 24, 2012
    Posts:
    49
    I made a custom projectile script for use on rocket projectiles. It requires a rigidbody and a collider of some sort. Then attach this code to the projectile itself...

    Code (csharp):
    1. public float speed = 20.0f;
    2.     public GameObject projectile;
    3.     public GameObject explosionPrefab;
    4.  
    5.     void Update()
    6.     {
    7.         transform.position += transform.forward * speed * Time.deltaTime;
    8.     }
    9.  
    10.     void OnCollisionEnter(Collision collision)
    11.     {
    12.              
    13.        if (collision.transform.name != "AdvancedPlayer")
    14.        {
    15.            Debug.Log(collision.transform.name);
    16.            Destroy(gameObject);
    17.             //Destroy(collision.gameObject);  this will destroy object that is hit
    18.            GameObject clone = (GameObject)Instantiate(explosionPrefab, transform.position, Quaternion.Euler(0, 0, 0));
    19.        }
    20.     }
    21. }
     
    Last edited: Jul 10, 2013
  49. bubbalovesponge

    bubbalovesponge

    Joined:
    Nov 8, 2012
    Posts:
    69
    Last edited: Jul 10, 2013
  50. BrandSpankingNew

    BrandSpankingNew

    Joined:
    Nov 20, 2012
    Posts:
    220
    You are having WAY too much fun!! Looks great!
     
Thread Status:
Not open for further replies.
unityunity