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. wheelbarrow

    wheelbarrow

    Joined:
    Sep 12, 2011
    Posts:
    177
    Has anybody had trouble getting the UFPS targetted? I have a turret in my scene that targets the player when they get within 20 units. Using the standard assets FPS controller, all works as expected, but the turret will not target me when I am using UFPS, unless I get within about 2 units.

    The turret is set up to target and follow a game object with the tag 'player', and like I said earlier, the bog standard FPS controller has no problem, so I know the turret is working correctly. I have put the player tag on the FPSPlayer object, not any of the children attached to it. Any ideas?? Thanks.
     
  2. Jebus

    Jebus

    Joined:
    Sep 17, 2011
    Posts:
    18
    Is it possible to use the Ultimate FPS controller to setup climbable objects?
    I currently own another camera system which lets you specify a tag name for climbable objects, and you just assign that tag to whichever objects you want to climb. Is something like this possible with the Ultimate FPS controller?
     
  3. bubbalovesponge

    bubbalovesponge

    Joined:
    Nov 8, 2012
    Posts:
    69
    I agree, I have been working on that issue. I have had to modify the code a bit to clean up objects. I would love to be able to share and exchange code so visionpunk's could have a full mobile platformed version that if he wanted could sell as a new product.
    So far what i did works very well, but you are right, once i get too many objects into the scene during gameplay it begins to slow down.

    If anyone tested my APK for the droid, let me know how it worked on your device.
     
  4. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    If you'd share your port with me I'll see if I can't share some of mine with you. :) Hey, maybe we can get this mobile port along faster!
     
  5. Rukey4

    Rukey4

    Joined:
    Sep 23, 2012
    Posts:
    73
    Looks like a fantastic product! I'm just on the fence as to whether it will lend itself easily for modification in terms of adding different weapons to the system? It does say it comes with 4 weapons, but does it come inclusive with the hand/arms prefab? Would I could rig them to add another weapon to the mix?

    Does any documentation cover this aspect? Or could I as from the demo video, swap the mace out for another melee weapon?
     
    Last edited: Jan 26, 2013
  6. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Hi there, thanks for the help, I have been trying it today but having some issues.

    Removing input commands:

    As far a I see in VP_FPSCamera there is only 2 lines to remove? These 2 in updateMouseLook():

    m_MouseMove.x = Input.GetAxisRaw("Mouse X");
    m_MouseMove.y = Input.GetAxisRaw("Mouse Y");

    Is that right?

    As for VP_FPSPlayer, I see a few things need removing, presumably anything with "Input." ? Infact im just wrapping them up in an if statement so I can go back to normal controls if needed. So that means pretty much wrapping the contents of each input method in my if, InputWalk() InputRun() etc.

    So after doing all of that and a compile you are left with 22 errors. Mostly these are complaining about "Controller" not existing in the current context. As well as StartCountDown and SetState amongst others.

    What do I do to get these things recognised? Sorry im very new to Unity.

    If I copy them from the top of FPSPlayer into FPSMobile, then add the lines to declare them in Awake.. I get down to 11 errors, is that a valid thing to do?

    Then to get rid of the setState() errors I stole setstate from fpsplayer and copied it into FPSMobile, as well as copying:

    public vp_FPSWeapon CurrentWeapon { get { return Camera.CurrentWeapon; } } from FPSPlayer into FPSmobile,
    and public vp_FPSShooter CurrentShooter { get { return Camera.CurrentShooter; } }

    I can get down to 6 errors, but from here each time I try to move the code I need into FPSMobile to fix the errors more and more come up, leading me to believe this is not the way it should be done.. Any advice would be great..

    OK so after more tinkering i took out the code for now that calls Reload, etc and finally got a compile. I dragged the fpsmobile script onto the fpsplayer object in the game.. i made dummy images for the graphics and tried it,

    i see the controls on far bottom left for up,down,left,right.. If I use them they kind of work, forward and back work, but before he does anything the gun jolts a bit weirdly, then he begins to move.. jump seems to work too again the gun does some weird stuff.. left makes him strafe left but it appears to zoom in and outt constantly, and right seems to right straffe perfectly.. So almost there I think :) I dont see any joystick allowing mouse looking and I dont see that in the code either? I see 4 rects in the code that dont seem to appear on the screen. He seems to get stuck in zoom mode too sometimes. I have attached a screenshot below.

    $wipcontrolsmobile.png

    I also tried your warehouse.apk but it failed to install Failure [INSTALL_FAILED_OLDER_SDK] - my nexus one is running Android 2.3.6 so I guess you built for 3.0 or something. Same Error on my tablet running 3.2.1.

    Curiously on my tablet I get slightly different results (also nexus one has flawed multi touch so that could be an issue - I use it more than tablet unfortunately as tab connects to adb one in every 50 times :(( )

    $wipcontrolsmobiletab.png

    As you can see more buttons appear, forward, back, left and right appear to work better, in fact they work fine! Even pressing them together moves you diagnally etc. jump seems to work, tapping the zoom key sort of works, I have to hold it down for a bit and then not keep pressing it (code be some of the code i removed as explained above), switch gun doesnt appear, and the reload icon does nothing (again prob cause i had to remove that code).. Still no means of looking around or shooting but sort of woking, and I can see the speed of my game, which is kind of slow, but im thinking making him run all the time would be a good idea, the frame rate doesnt seem too bad, I will need to add an fps counter.
     
    Last edited: Jan 27, 2013
  7. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    +1 ! I would really like to see a mobile port of this.
     
  8. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Me too!!
     
  9. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Last edited: Jan 27, 2013
  10. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    I think the error is something to do with the weapons pivot creation, any ideas?
     
  11. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    Ta Daaaa!


    Here's it working on my iPad mini. At the moment you double tap the left joystick to fire and double tap the right to jump. :)



    The issue was to do with the stripping level. I read about it from this post.
     
  12. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hey guys,

    Sorry I'm a bit absent right now. The reason is simply that I'm in crunch / bunker mode on the next version. Many sleepless nights. Been hoping to get it done by the end of January. Let's see what happens :).

    A couple of things you should know:
    • I want to remind you that the next version really is a big, big overhaul of the whole code base. A reboot if you will. I'm planning to write an upgrade guide with a checklist of steps that need to be taken for upgrading an old project to the new code, but obviously the more modifications you may have made to the files, the trickier it might be to upgrade an existing project. I'm well aware that this is a pain, and one aspect I've put a lot of thought into this time is making the systems easier to override / inherit in separate files for smoother future upgrades.
    • 1.4 focuses on these things:
      1. bugfixes for many, many known issues (among them pausing)
      2. new features, among them: new weapon animation features, completely rewritten contoller physics with sliding, better jumping, bullet time support, a solution for weapon/object intersection when disabling the weapon camera, and much more
      3. a really big system cleanup, including a complete directory structure overhaul, and a code overhaul addressing some of the system design issues discussed in this thread lately
    You may notice that mobile is not on this list. If performance is better on mobile it's a happy accident, and there is no mobile controls (simply been too bogged down). I think mobile should be an update on its own though (likely a quicker one) and it will be the #1 prio after this release, rest assured.

    Thanks for your patience. The stuff you've been posting looks awesome!

    Cal
     
    Last edited: Jan 28, 2013
  13. PlayMagicLtd

    PlayMagicLtd

    Joined:
    Aug 23, 2012
    Posts:
    48
    Hi,
    We need to use the Melee combat, and did not find the right way to handle it. Can you give us some help?
     
  14. bubbalovesponge

    bubbalovesponge

    Joined:
    Nov 8, 2012
    Posts:
    69
    Frickin Awesome! I like that approach, very cool.
     
  15. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Looks great. finally got mine going nicely too (thanks to your hard work - much appreciated), working out how to fire is the toughest bit, not quite sorted how firing will work because ideally id like the player to be able to move and look whilst firing, but maybe thats asking too much for a touchscreen fps.
     
  16. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Extremely excited by this!! And really love the awesome support and feedback you give on this asset, Im gonna stop making changes today and re-integrate when ever the new update comes out :))).. Thank you so much.
     
  17. bubbalovesponge

    bubbalovesponge

    Joined:
    Nov 8, 2012
    Posts:
    69
    If you need help just Private Message me you email address. I would be more then happy to help.
     
  18. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Put a hit box and the end of your weapon, or spawn a short lived game object to represent the distance you can swing or hit at.
     
  19. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    Hi,

    Someone may have asked this before but I can't find it, have you got your weapons as prefabs without the arm, I like the pistol and would like to lay it in the scene to pick up, but obviously I don't want it laid there with the arm attached !

    Thank you !
     
  20. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
  21. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Yeah, it's part of the new update, along with a bunch of example pickup scripts with various effects.
     
  22. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
  23. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,255
    I'm wondering if you can help. I'm getting this error and I'm not sure what I've done to cause it.

    Any ideas?
     
  24. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi derkoi, Hmm, hard to say. Does it happen with a clean install of the system (no modifications to the source)?
    Does the issue happen when you run the example demo scenes, or does it happen when you import the player prefab into a custom scene? What changes (if any) have you made to the source code ?
     
  25. ineteye

    ineteye

    Joined:
    Sep 12, 2012
    Posts:
    35
    Hi! Can you advise, what is best solution to disable Gravity for controller in your module. Just like in space....
     
  26. EliteMossy

    EliteMossy

    Joined:
    Dec 2, 2012
    Posts:
    513
    When is 1.4 going to be released? Also will it be easy to convert to 1.4 from 1.3? I have heavily modified 1.3 and do not want to have to do it again

    Thanks
     
  27. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Oh that's easy. Just select the FPSPlayer in the hierarchy, find its FPSController component in the inspector and modify its "Physics -> Gravity Modifier" parameter. If you want spectator-mode style flying in the direction the camera is facing, that is also quite possible. Have a look at this post. Combining that with the astronaut example presets from the demo would be quite interesting I think. The files used for the Astronaut example are:

    AstronautCamera.txt
    AstronautController.txt
    AstronautWeapon.txt (used only to hide the weapon as far as i can recall)

    The demo (vp_FPSDemo.cs) loads these kind of "brute force" onto the FPSController and FPSCamera components. However you should really use the state system to assign the presets in the editor. For more information about this, see the chapters "Presets" and "States" in the manual
     
    Last edited: Feb 2, 2013
  28. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    I assume you've already read this post. I want to reaffirm that yes, it is basically a complete rewrite of the system, incorporating much of the great user feedback I've gotten over the last three months. How hard it will be to transition an existing project will depend on the nature of your modifications. If you have done them by overriding classes, that is probably a good thing (all your code will be isolated). If you have modified the source directly then you'll have to analyze the new code and try and find the corresponding places to change (hopefully they still exist). But at a quick glance:

    • FPSPlayer: completely rewritten
    • FPSController: reorganized and partly rewritten
    • FPSCamera: reorganized but mostly the same (weapon code ripped out)
    • FPSWeapon: reorganized but mostly the same
    • FPSShooter: weapon and inventory placeholder stuff ripped out (a new isolated placeholder system is in place for inventory handling).

    The system is now very loosely coupled. i.e. most of the components have been made completely independent of eachother. To this end, the parts communicate via a delegate based event system. The design is far cleaner and I hope easier to understand. Game specific logic should now be much easier to keep in your own separate classes, minimizing future upgrade troubles.

    It will also be a lot easier to replace one or more of the subsystems with custom ones (for example your own controller, camera or weapon system). And the other way around: it will be a lot easier to lift a single system (such as the camera) and put it to use in your own existing FPS solution.

    Opting between releasing soon and releasing solid I always opt for the latter. I'm guessing 1.4 will be out within the next week or two, but I've been wrong in the past. Release dates are mythical beasts. Or as Douglas Adams once put it:

    "I love deadlines. I love the whooshing sound they make as they fly by."
     
    Last edited: Feb 2, 2013
  29. ineteye

    ineteye

    Joined:
    Sep 12, 2012
    Posts:
    35
    Maybe there also easy way to make weapon in each hand? Something like mirror "WeaponCamera"?
     
    Last edited: Feb 3, 2013
  30. Jebus

    Jebus

    Joined:
    Sep 17, 2011
    Posts:
    18
    Hi VisionPunk, I would like to ask again about setting up climbable objects (such as a ladder). In another camera system I own it's as easy as setting a tag name and then assigning that tag to an object you want to climb. I've purchased the Ultimate FPS Camera from the asset store and had a quick search through the documentation provided but I can't seem to find anything that indicates you have a similar system.

    Is it possible with your system, and if not is it something you've considered for a future release? Cheers.
     
  31. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    We're not going to tell you how to code it. Yes, it can be done, you just have to modify the code.
     
  32. Jebus

    Jebus

    Joined:
    Sep 17, 2011
    Posts:
    18
    I'm actually asking if it requires any coding at all to setup. I'm not a programmer (only visual scripting using Uscript), and in another camera package it was as simple as going into the 'climb' component option, setting a tag name that I want to use, and then assigning that tag to any object I want to climb.
    If modifying the code is the only way to achieve this in the ultimate FPS system, than that answers my question, as I thought this system may have a similar feature.
     
  33. feloxy

    feloxy

    Joined:
    Jul 30, 2009
    Posts:
    338
    Hi,

    I purchased the camera and I was wondering, How would I go about making a different kind of zoom for each weapon, I tried messing around with the camerazoom file but this changes the zoom for all the weapons at once. Also, is there a preset of some sort to put a sniper scope image with an alpha when you zoom in ?

    thanks
    Vincent
     
  34. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi Jebus, It is definitely something I'd like to add when my current workload clears up a bit. Basically the answer to your question is: yes, you need to code it and yes it is possible. I wrote up some ideas on ladder implementation a while ago. Can't remember if I posted it in this thread so here goes:

    • Have a special collider on the ladder, tagged "Climbable" or something.
    • As long as the player is in contact with this collider, gravity is turned off and the "Forward" / "Back" bound keys will elevate or lower the controller at some predefined speed.
    • If the player presses jump while in contact with the ladder, the controller gets a velocity impulse away from the closest point on the ladder collider.
    • When a player reaches the top of a ladder, it is sometimes good to apply a force to the controller, pushing it up and forward over the edge.
    • For cases when a player approaches the top of a ladder from above (i.e. a rooftop), there should be some logic to detect the bottom of the controller, turn the player around and attach it to the ladder some distance down.
    • In order to avoid accidentally attaching to a ladder while brushing past it (which can be very annoying), it can be a good idea to only attach the player to the ladder if the inbound velocity is above some threshold. You may also want to check if the player is in fact facing the ladder.

    Hope that's useful and good luck ...
     
  35. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi feloxy, Sure. First be sure to read the chapters about presets and states thoroughly so you know how they work. I'd then recommend creating different camera zoom presets and states for the different weapons. Basically, instead of having just one zoom state for the camera you have many, and you make that context sensitive (depending on current weapon) in script.
     
  36. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Hi inteye. Sorry, this is not going to be included soon. It's on my list for future features though. Currently, I recommend keeping both weapons in the same mesh (making them in fact one weapon).
     
  37. Jebus

    Jebus

    Joined:
    Sep 17, 2011
    Posts:
    18
    Cheers, thanks for the info. It sounds like the implementation that you'd planned would have been great.
     
  38. Original-Big-Dan

    Original-Big-Dan

    Joined:
    Feb 5, 2013
    Posts:
    10
    Hi Cal!
    I love the framework, it's rather lovely!

    I have a question about whether it's supported or what sort of approach you'd recommend.
    I'm want prototype a game where you can walk around inside a pilotable spaceship which can fly through space.
    I'm guessing I will have to do some funny stuff with gravity for when the ship rotates. How would you tackle 'anchoring' the player to the ship for when the ship is moving? Is it as simple as parenting the player to the ship?
     
  39. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    I'm very interested in this asset for mobile.

    I understand that many people have tweaked this to get it to work on mobile, but when do you anticipate an out of the box solution?

    Thanks,
     
  40. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Sorry if this was answered in the thread already; search seems to currently be broken. I was wondering what the best way to implement a secondary fire mode on a weapon would be. I'd like some guns to zoom with the right mouse button as they currently do, but others to do something else. I don't see a simple way to do it; I was thinking I could change the vp_FPSWeapon and Camera classes to support two vp_FPSShooter objects, a primary and secondary one, and default to zoom if there's no secondary FPSShooter defined. I'd have to mess with those classes a bit since they currently figure out what they own by using GetComponentInChildren rather than having an assigned variable. Is this the best way to implement secondary fire?
     
  41. ineteye

    ineteye

    Joined:
    Sep 12, 2012
    Posts:
    35
    And about 2 weapons in each hand ... each use differ buttons to shoot?
     
  42. doomprodigy

    doomprodigy

    Joined:
    Dec 12, 2010
    Posts:
    87
    Looking forward to 1.4., By the sounds of it, it will make it a lot easier to modify the code.
     
  43. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Yes, seems quite interesting.
     
  44. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Wow, that's an interesting question. One issue is that the Unity CharacterController can't be rotated freely. Real quick I think something like this might work:
    • Don't move or rotate the ship "for real". Just keep it sitting in the center of the scene (or at some location far away).
    • Instead of moving and rotating the ship, render the surrounding space using a special flying camera. Use layers to make sure this camera never renders the actual ship (or its contents), and to make sure that what gets rendered in the windows of your spaceship is "nothing".
    • What happens every frame should be
      1. Space cam renders the environment to the screen.
      2. Interior cam (main camera on the character controller) renders the interior of your ship on top of that. Where there are windows, the space background will show through and the background will rotate as if the ship was rotated.
      3. Lighting is an issue. Perhaps you need to have some light sources rotating around the ship, mimicing the rotation of the space camera.
    I can't delve further into the specific details of hooking this up with camera layers etc. but make a few searches around the forums and in Unity Answers. It should be fairly easy to achieve in Unity.

    Hope this gets you started in the right direction...
     
    Last edited: Feb 7, 2013
  45. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Sometime this spring I hope.
     
  46. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    I think that's a good general approach. In v1.33 the firing isn't all that entangled in the camera and weapon classes as I recall, so not sure it's absolutely necessary to modify the source. If you just fetch and keep a reference to each shooter in some other script that takes input it should be easy to make them fire independently. Let me know if you need further help.
     
    Last edited: Feb 7, 2013
  47. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Wow, that sounds awesome ;) ... but yeah, I think you can have an unlimited amount of shooters active. As long as you can fetch them to your own script by using one of the GetComponent approaches and store a reference to them, there should be nothing preventing you from binding separate buttons to each shooter.
     
  48. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    I feel a little embarrassed, and also this may not me a UFPS thing either, but I just noticed by keeping the 'forward' button pressed and hitting 'Jump' I can move vertically up a 200 metre terrain object.

    I've been trying for a good hour and I can't stop it I'm guessing its simple to prevent but I just can't get it to stop.

    So walk forward until you hit the hillside which is more or less vertical keep 'Forward' 'W' pressed and repeatedly hit 'Space' 'Jump' and up I go !!!

    Any help greatly appreciated.

    Thanks !!

    ****UPDATE****

    Figured out how to do it using a normal controller, but Hmmm, me thinks with UFPS I need to do something with States and I'm stuck.........

    QUESTION 2

    Yep two in one day, I have a long piece of chain link fencing with one box collider around the whole lot, obviously when I shoot it I'm left with a bullet hole floating in space, I'm wondering wheres the best place to handle this ? Is it where you raycast in vp_Bullet.cs ??

    Thank you !!
     
    Last edited: Feb 9, 2013
  49. VisionPunk

    VisionPunk

    Joined:
    Mar 9, 2012
    Posts:
    711
    Yeah. This issue can be fixed by checking the angle of the ground and disabling jumping if the ground is too steep. Upon jump, do a raycast straight down and get the hit normal. If ground is above a certain angle, don't allow the jump. This is fixed in the upcoming version. PM me if you need more help sorting it out in the meantime.

    Yes, tag the chain object with something (for example "nodecal") and where vp_Bullet.cs places the decal, insert a check for that tag and bail out if the hit object has the tag.
     
  50. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    Excellent, the Jump can wait until the next version, I think you'll be finished before me (at least I hope you will)

    And thanks I'll amend vp_Bullet later and see how I get on,

    Thank you very much for the reply !
     
Thread Status:
Not open for further replies.