Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Also, that's a nice way to make invisible walls and such that prevent players from putting decals on them.
     
  2. jrkienle

    jrkienle

    Joined:
    Apr 14, 2012
    Posts:
    71
    Hi VisionPunk! I have another question for you. How would one build a shotgun style weapon (meaning a weapon that shoots multiple bullets at the same time)
     
  3. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    By modifying the UFPSC code. Try VP_Bullet.cs.
     
  4. jrkienle

    jrkienle

    Joined:
    Apr 14, 2012
    Posts:
    71
    I figured it out. You have to change the amount of projectiles that spawn per click
     
  5. Geoffc

    Geoffc

    Joined:
    Feb 4, 2013
    Posts:
    39
    Hi /Cal,

    Looks like a good camera for a FPS. Does it support ladder climbing?
     
  6. klaussilveira

    klaussilveira

    Joined:
    Nov 18, 2009
    Posts:
    12
    Does the Flash exporter in Unity 4 support this pack?
     
  7. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
  8. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi klaus, I'd say no at this point. There are some reports of people having difficulty building it for Flash. It's probably possible to get it up and running but you need to be adept at finding the causes of the build problems. As for performance: no idea.
     
  9. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    I got FPS camera a couple of days ago - it is brilliant BTW - one issue I am having is I can't track the player with a sentry turret I've added.

    The script for the turret tracks the Unity standard First Person Controller fine (you just have to assign it a 'Player' Tag, but it will not track the FPS camera player. I have set the "Player" Tag on the FPSPlayer object.

    The script code is below - any ideas why this will not track the FPS camera player?

    Code (csharp):
    1. var attackRange = 10.0;
    2. var shootAngleDistance = 30.0;
    3. var target : Transform;
    4.  
    5.  
    6.  
    7. function Start () {
    8.     if (target == null  GameObject.FindWithTag("Player"))
    9.         target = GameObject.FindWithTag("Player").transform;
    10. }
    11.  
    12. function Update () {
    13.  
    14.  
    15.  
    16.     if (target == null)
    17.         return;
    18.    
    19.     if (!CanSeeTarget ())
    20.         return;
    21.        
    22.        
    23.     var relativePos = Vector3(target.position.x - transform.position.x, 0, target.position.z - transform.position.z);
    24.     var rotation = Quaternion.LookRotation(relativePos);
    25.    
    26.     transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * 2.0);
    27.    
    28.  
    29.     var forward = transform.TransformDirection(Vector3.forward);
    30.     var targetDir = target.position - transform.position;
    31.     if (Vector3.Angle(forward, targetDir) < shootAngleDistance)
    32.     fire();
    33.    
    34.  
    35.        
    36.  
    37.  
    38. }
    39.  
    40. function CanSeeTarget () : boolean
    41. {
    42.     if (Vector3.Distance(transform.position, target.position) > attackRange)
    43.         return false;
    44.        
    45.     var hit : RaycastHit;
    46.     if (Physics.Linecast (transform.position, target.position, hit))
    47.         return hit.transform == target;
    48.  
    49.     return false;
    50. }
    51.  
    52.  
    53.  
    54.  
    55. function fire(){
    56.  
    57. print("bang");
    58.  
    59.  
    60. }
     
  10. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    VisionPunk,

    Just wanted to remind you of how great your UFPS is, why am I saying this ?

    Because I'm a commercial programmer during the week, boring database apps (well I don't find it boring obviously) games is spare time just for fun to fill an ambition of mine.

    So just wanted to give you some encouragement, you are working flat out on the new version and still politely answering questions, I know exactly what thats like, just wanting the new version finished but still supporting the old.

    So anyway just wanted to say well done, really appreciate what you have done, it makes my FPS game feel like I bought it in a store, so that says it all really.

    Looking forward to the new features, keep smiling and sleeping now and then is a good thing ;-)
     
  11. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    Funnily enough having the exact same problem now! Just posted about it above.

    Did you manage to work out a fix?
     
  12. Wrekk

    Wrekk

    Joined:
    Jul 16, 2012
    Posts:
    51
    Could someone explain this any further? I can't seem to find it in the scripting chapter (sorry if it's just me being retarded).
     
  13. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    I have been using your asset for some time and it’s very nice to work with. I was going to use the FPS Multiplayer KIT for a small project, but photon cloud is not for me. So I built a small network system that fits over the FPSPlayer prefab, it works very well and I’m now looking at extending the asset to handle more functionality.

    One thing I wanted to ask you: Did you already code a weapon pickup system? I was going to build one and extend the asset but I quickly noticed in a few posts back that you may have already made one?

    The other thing I was looking at is weapon prefab instantiation on pickup, but I guess if there is a pickup system it would probably do that already. Lol, now I think of it I will probably have to modify it anyway, as I will make it instantiate after the player has selected the item as a fitted weapon and have an auto instantiate if the weapon slot is empty on pick up.

    Any way, please let me know when you got 5 ;)
     
  14. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi supericon, a quick guess: it might have something to do with the player gameobject's layer being set to "vp_Layer.Player" in "vp_FPSCamera.Awake".
    I notice your script uses a raycast. Perhaps the gameobject is invisible to the raycast because of the layer? I'd make a quick test disabling the layer set just to see if that's it. Otherwise, I recommend placing some debug prints throughout your script to see which "if" statement it is that fails. Does it fail because the script can't find the "gameobjectwithtag", or does it fail because it can't raycast to it?
     
  15. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Wrekk, I don't think you're retarded :). The info seems to be missing from the manual. This is how to provide a callback for the bob step (object names and example from vp_FPSDemo) :

    Code (csharp):
    1.  
    2.     m_Player.Camera.BobStepCallback = delegate()
    3.     {
    4.           m_Player.Camera.AddForce2(new Vector3(0.0f, -1.0f, 0.0f));
    5.           m_Player.Camera.CurrentWeapon.AddForce(new Vector3(0, 0, 0), new Vector3(-0.3f, 0, 0));
    6.           m_AudioSource.PlayOneShot(m_StompSound);
    7.      };
    8.  
     
  16. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    TryHarder, thanks for the encouragement. To be honest this update is proving a real tough one to get out. Getting there, slowly but surely though. Lots of polish and small bugs to fix. I'm now refactoring the old demo scenes (+ a new one) to the new system which is a bit tricky because many things work a little bit differently and the demo code is from the early stages of v1.0 development. Soon there ... will remember to try and get some sleep :)
     
  17. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey superme, Yeah I have a simple inventory system and pickup example scripts for powerups, health, ammo and weapon for release in the next version. All of this is placeholder / example code though so it's not 100% certain you will want to use it. If you are planning a database solution for inventory (i.e. over network) then it's safe to go ahead and write that. My stuff will be client side stubs.
     
  18. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Dude that’ sounds sweet!!!!! I’m already using the vp_DamageHandler, its really handy as a utility script.

    Is there any way I can find out when the next version is released? Lol, if you keep building versions like this you will end up with mini framework, dam good one to.

    Client side stubs, perfect way to focus, network code is an invisible time eater ;P
     
    Last edited: Feb 20, 2013
  19. Ahdireyo

    Ahdireyo

    Joined:
    May 5, 2012
    Posts:
    33
    I just bought last night. Is there a way to make the weapons shoot by clicking. Instead of holding the mouse fire it to fire continue sly. For instance I keep clicking the pistol to fire, and if I hold the right mouse button it won't fire anymore untile I click again

    All in all great work. I like it can't wait for updates.
     
  20. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Yow, networking system working.
    So far:

    Update: I have now gone full authoritative, I had some issues with sending damage out to connected clients/players, it was more complex than expected so I did some testing with a full authoritative and got the exact results I was after. And also the player damage handler is now working fine using the (vp_damageHandler).


    1. Player Object to represent player, with local instance of FPS Cam, the whole thing ;p
    2. Damage system on server based objects that react to the client FPS cams and bullets (vp_damageHandler).
    3. Player Damage that updates the FPS cam from server to client (vp_damageHandler).

    So basically the player shoots the enemy (AI dude) created by the server and the AI dude takes damage from the FPS cam that isn’t even on the server. And everyone is running wild shooting each other represented by a server based objects (army dude models) as in most FPS’s.

    Going to refine this loads, put out a player demo and the get it ready for the DB/Server connection for the next update ;)
     
    Last edited: Feb 24, 2013
  21. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    Hi VisionPunk, i love your work, but i have a question regarding showing a bullet flying in the air. I'm making a pulse rifle and i want to see the projectile flying out of the barrel onto the target. How can I do this?
     
  22. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Read the docs. Spawn a game object with a trail renderer.
     
  23. theSoenke

    theSoenke

    Joined:
    Dec 4, 2012
    Posts:
    106
    When is 1.4 coming? I can't wait anymore :)
     
  24. Wrekk

    Wrekk

    Joined:
    Jul 16, 2012
    Posts:
    51
    I'm having a slight problem, for some reason my arms are shaking in a way they shouldn't. It is really hard to explain, do you want me to send a demo scene to you?
     
  25. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    Where exactly in the documentation? I've made sure to read it even before i posted and i still cant find anything. All i can see is this, which only spawns a gameobject on inpact:

    Particle FX Prefabs The bullet will optionally spawn a number of gameobjects at the point and moment of impact. Technically these prefabs could be anything, but their intended uses are as follows:
     
  26. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    In the gun properties, you have to set a game object that is "fired". The default ones just do a raycast and place a decal, but you could replace it with a game object that moves at a high velocity with a trail renderer.
     
  27. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    Thanks for your response.

    If you are refering to Vp_FPSShooter and the Projectile prefab, it doesnt seem to work though
     
  28. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    I believe that it's VP_Bullet.
     
  29. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711


    This all sounds awesome. Curious to see it in action when possible :)
     
  30. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    I will be putting up some working examples. It should all work in the web player, if not I will make it ;p... Also I will pass credit to the UFPSC asset.

    Its nuts that I could build this so fast using the FPS cam. But I still got loads to do before it’s actually put out a playable demo.

    Will keep you updated.
     
  31. Wrekk

    Wrekk

    Joined:
    Jul 16, 2012
    Posts:
    51
    Hi, sorry if I'm posting a lot guys, but I have a problem. For some reason when I implemented akimbo (dual wield), it wouldn't render some parts of my left arm. http://imgur.com/eRANqSU

    I honestly have no idea what's causing this. Anyone got an idea?

    Best regards,
    Bastian
     
    Last edited: Feb 23, 2013
  32. x70x

    x70x

    Joined:
    Aug 20, 2011
    Posts:
    49
    I swear I've followed every direction here and in the documentation, but I cannot for the life of me get the ssao image effect work on the FPSCamera. I'm getting this stripping effect

    Anyone know what I'm doing wrong?
     
  33. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Are you applying it to the right camera?
     
  34. x70x

    x70x

    Joined:
    Aug 20, 2011
    Posts:
    49
    I sort of figured it out. It's a compatibility issue with the Unistorm plugin. Unistorm requires the main camera to have a far clipping plane of about 100000 so that the sun/moon/etc get rendered, but that causes the depth buffer to be essentially "stretched" creating the artifacts in the ssao.

    I am now messing around with a 3rd camera that only renders the Unistorm assets behind the main camera where the main camera has a more reasonable far clipping plane of about 2000. The artifacts are gone; however, I can't get the 3rd camera to work correctly because I'm assuming I need it to be a child of the FPSCamera game object in order to be linked 1:1 with the FPSCamera's position and rotation. When I make it a child of the FPSCamera the Vp_FPSWeapon script thinks it's a weapon camera and changes many of the camera's settings at runtime, include the clipping planes and culling masks.

    Is there any way to alter the Vp_FPSWeapon script to only change the settings for only the game object named WeaponCamera and not just every camera that it's a child of FPSCamera? I'm really not good with code so if anyone has a fix for this please let me know.
     
  35. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    I have a problem, When im trying to make a moving platform that supports the character (in this case a train) the train moves but the character stays still untill the character gets slammed on the rear wall of the train and stopping the whole wagon. How can i make it so that my character moves with the platform and collides properly with it without spazzing or dying in fall damage. And when is 1.4 coming out btw?
     
    Last edited: Feb 24, 2013
  36. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    Did you make the character a child of the train?
     
  37. Midas89

    Midas89

    Joined:
    Feb 13, 2013
    Posts:
    13
    Hi again guys, im having some issues regarding damage handling on my network instantiated players. the bullets go right through the players. Any ideas why this is happening? It has a Character controller on it of course, and i tried to add a mesh collider but it made no difference.

    I also added this function in my own damage handler:

    public function Damage(dmg : float){
    health -= dmg;}

    I've been reading through the code and the documentation but i could still use a hand setting this up. Thanks in advance, its much apriciated.

    Also i tried adding my own bullet script and in my old ways of handling damage i had on collision enter take damage from specific projectiles. this works with my previous setup before i switched over to UFPSC. It didnt work either.


    Edit: I'm starting to think it has to do with raycasting not working onstantiated objects. Any ideas?
     
    Last edited: Feb 24, 2013
  38. Ahdireyo

    Ahdireyo

    Joined:
    May 5, 2012
    Posts:
    33
    I bought this a week ago. So when you update how can we get the newest version? Can you pm me the link to the repo
     
  39. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    I don’t think the ray trace from the prefab (networkView) will do that. It seems to me that you are trying to call an RPC based on the impact. If that is the case then there is no need, you can use the vp_damageHandler to take care of it.

    How it works you may be thinking?

    The network system traces NetworkPlayer and NetwrokViewID so no need to worry about who did what as unity is already doing it for you. In my system I update the health based on the vp_damageHandler m_health (may not be m_health but its m_ something) and if it reaches 0 then the player is dead. To find the correct player I use the NetworkPlayer. and and RPC call..

    Note* my player objects instance is created on the server, so anything that happens to that object is reflected to all connected clients. (authoritative).

    Be sure to check out, NewtorkPlayer, NetworkViewID and NetworkView.Find()

    There is a few more, best advices is to spend some time with the docs’s as some things need a little thinking about to understand. O and pack plenty of coffee ;)
     
    Last edited: Feb 25, 2013
  40. J-F

    J-F

    Joined:
    Nov 8, 2012
    Posts:
    101
    Well doing this just break everything. the character goes half underground and the train responds somehow to the mouselook script even if the character that includes that script is the child of the train. But anyways this method won't get me anywhere. I still want the character to be able to move in the train and leave the train without having any connections to the train itself. The problem looks like the train isn't strong enough to move the character, like it would be solid. But adding more strenght to the train triggers the falling damage which kills the player and even with that force the train won't move at all...
     
  41. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Don't you need to transform the position of the train to the object? So in other words add the train position to the player position + any extra position information like player move foreword e.t.c

    I guess then you could activate/deactivate the position update and even slow it down when the player jumps.

    Just an idea, not sure if it would work.
     
    Last edited: Feb 25, 2013
  42. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Ive been playing dead trigger, the mobile controls on this FPS are really nice - i think they would work great with ufps, just a heads up to VisionPunk in case you want to see a decent implementation for when you do the eagerly awaited mobile version lol.. having weird issues on mine, seems like x is inverted on some devices..
     
  43. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    The whole point of UFPS is to provide a base from which you can build off of by changing the source code. That's why the code is included. If you like Dead Trigger's implementation, you can code it in yourself. The mobile support e is adding is rudimentary I believe; you still need to do work to make it look good.
     
  44. Vumi

    Vumi

    Joined:
    Dec 31, 2012
    Posts:
    2
    Hi, I am having a problem with this. I use UniStorm, when I add the Vp_FPSCamera script to the camera in the UniStorm prefab it stops rendering rain particles. I have worked all day to find the cause and it is definitely related to this script. Any ideas what could be causing this?
     
  45. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Sweet. We'll have loads to talk about whenever I start looking into networking :)
     
  46. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Bastian, That's really hard to say but my guess is it's probably something to do with the model and materials (i.e. a content issue).
     
  47. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi, you should be able to fix this easily I think, by naming your camera something (in this example: "SomeName") and changing the following line in vp_FPSCamera->Awake:
    Code (csharp):
    1.  
    2. if (weaponCam != null)
    3.  
    Code (csharp):
    1.  
    2. if (weaponCam != null  weaponCam.name != "SomeName")
    3.  
    Hope this helps
     
  48. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Moving platforms are not supported yet. In the meantime I've been recommending people to mod the vp_FPSController with the platform logic from the Unity FPS examples, and have gotten back from users who've done this successfully. Just a tip.
     
  49. superme2012

    superme2012

    Joined:
    Nov 5, 2012
    Posts:
    207
    Yeah cool.

    I’m just working on the re-spawn code now. I noticed that if authoritative is used then it’s a good idea to set a custom playerName as the game object name on the server, and to pass the playerName (string) and NetworkPlayer into a script of the server instance player object.

    By doing that it makes development much smoother as it’s possible to identify the correct player with the correct game object. These are not linked by unity as the FPS cam is only on the client.
     
  50. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Yeah, think I replied to a similar question a few pages back. Raycasting seems to be a culprit in some cases. I'd have a good look at exactly how the raycast logic is set up in the bullet script you're using (which layers and tags it excludes or includes) and how the target objects are layered and tagged. I haven't heard anything about raycasting not working on instantiated objects.
     
Thread Status:
Not open for further replies.