Search Unity

FX Camera Systems

Discussion in 'Made With Unity' started by ForceX, Jul 10, 2011.

  1. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update 1.3.7

    New Features:
    1. Weapon recoil effects. (First Person Action Only).

    Changes:
    1. FX_Camera (FirstPersonAction) no longer displays and option for "Visualize Camera Debug". This is because after Update 1.3.5b there is no camera collision debug information to display for this camera mode.



    To enable the weapon recoil:
    FX_Camera Inspector Settings
    1. Set "Camera Style" to "FirstPersonAction".
    2. Enable "Allow Weapon Recoil Camera Shake"
    3. Apply your weapon to the "Active Weapon" GameObject field.

    FX_Weapon_Linecast Inspector Settings.
    1. Under "Scripting Overides" Enable both "Align Weapon To Camera" "Enable Weapon Recoil".

    Run

    If you are using an inventory system that allows for weapon swapping you will need to apply the new weapon to the "FX_Camera.ActiveWeapon" and call the "FX_Camera" function "SetupWeapon()" when you equip the new weapon. This will map this weapons unique settings to the camera for the Weapon recoil effects.


    Updated the First Person Action Demo to latest build.
     
    Last edited: Aug 20, 2011
  2. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Wow...perfect!

    Unity 3.3 version fix:
     

    Attached Files:

  3. daywin

    daywin

    Joined:
    Jul 13, 2011
    Posts:
    9
    ForceX :thx a lot
     
  4. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    FYI new daily builds will have their updates posted on the first post at the top under "Daily Build Notes" bigger releases will still be getting a new post. If you are following this project please check the top of the first post for your daily fix :). Buttt since your here i'll go ahead and start things off with..

    Daily Build 1.3.7b <--- the letter makes it a daily build.
    1. Better memory management. Almost 6x in some cases. 1.3.7 saw the FX_Camera Update() at .6kb, now in 1.3.7b it's 104b.
    2. FX_Motor has a new LeanState. This will handle the player state for Center, Lean_Left, Lean_Right.
    3. Prone state expanded to include all eight directions.
     
  5. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Thank you! I follow this thread with big interest!
    Max

    p.s.

    I did try the "ThirdpersonRPG" camera style and if it can be usefull, i post my impressions:
    - It could be nice if that the cursor switches between 3D version (on the ground) to identify the new destination point and 2d reticule (on an interactive object) to check actions or to shoot targets.
    - another upgrade can be the rotation of the player to the direction of the weapon shots.

    Unity 3.3 fix :
     

    Attached Files:

    Last edited: Aug 24, 2011
  6. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Very fast version!
    I noticed only now that the weapon recoil has a effect also on camera ..very cool!
    Regard the weapon script, I think that a reload button (like "R") could be a usefull adding!

    Found one little issue..E key is used both for "action" and for "lean right"

    Regards

    Max
     
    Last edited: Aug 24, 2011
  7. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Sjm Tech: Thanks for the catch with the interact key i've posted up an updated version (1.3.7c) the key is now "F" this release also has a WIP build of the Isometric camera. It's not quite ready yet, still have some LookAt issues i'm working on.
     
  8. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Hi ForceX, "Isometric camera" work very well.

    I notice (because surely is a WIP version):
    - ThirdRPG and Isometric do not have enabled : reticule color option , and detect object range.
    - in Isometric style Auto cursor has no effect.
    - in ThirdAction style mouse wheel zoom do not work anymore.

    Regards
    Max
     
  9. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    1. Reticule color is currently only for the action cameras. The .color works on them because they Use a GUITexture which allows a color change through script. The mouse cursor uses a DrawTexture Rect which I believe does not allow access to .color information. It Is setup this way because the mouse pointer needs the ability to render over other GUI elements. So the mouse pointer is a but more limited than the reticule ATM.

    2. Auto cursor was not included at time of release but will be when its final.

    3. Mouse wheel should work. Press "C" to change the camera from the fixed over the shulder (secondary position) to the over head camera (primary position). In case I will check it out when I get home from work.
     
  10. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    1.understood... a solution could be to add another cursor when action is in the range (different by normal actions cursor).
    For example: Cursor door Texture + Cursor door Texture in interaction range. Sorry if i'm not quite clear!
    2. was what I thought.
    3. yes i mean in "C" camera mode


    Max
     
  11. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Sjm Tech: The camera for the ThirdPersonAction is fine the "Lock Camera Dolly" got checked. Just un-check it under "Camera Primary Position Offset" and it will be back to normal.
     
  12. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Oops... sorry, I forgot to check this setting!
    Thanks
    Max
     
  13. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update 1.3.8

    New:
    1. Added "Head Bob" settings to FX_Camera "Camera Extended Settings"

    Fixes:
    1. Player Controller will no longer interfere with object Interaction.
    2. Interactions now ignore passive activators Ignore Raycast
    3. Weapons no longer collide with passive activators Ignore Raycast

    WIP:
    1. Weapon sway. Same as Head Bob but for weapons. This is located in the WeaponLinecast script under "Scripting Overrides"

    Updated First Person Action DEMO to current build. Demos can be found at the bottom of the first post.
     
    Last edited: Aug 27, 2011
  14. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Great, another big upgrade!
    - "Head Bob" system is very realistic!
    - "Weapon sway" very good effect in motion (during walking) but it could be more realistic adding this effect also during the free look (without be walking).
    I mean something like this
    i was thinking that, at this point, it could be a nice looking adding a breath movement on idle (slight head bob but when standing still).

    Unity 3 version:
     

    Attached Files:

    Last edited: Aug 27, 2011
  15. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update 1.4.0

    Major Change!!
    1. FX_Camera FX_Motor have been merged into a new script FX_Character_Controller. This was a necessary move as both scripts were increasingly dependent on the other. As a result there are fewer redundant var, place holder var, and an speed increase of around .20+ ms.

    New Features:
    1. First Person Action now has usable "Crouch" "Prone" states. Cycle between states with "Left Ctrl". Go to standing with "Z" or "Jump".
    2. First Person Action now has usable "Lean Left" "Lean Right". To lean press "Q" to lean left or "E" to lean right.

    When in First Person Action it is recommended to disable the Player Actor mesh renderer.

    WIP
    1. When crouching under an object standing up will cause the player to clip through the object. Working on this.

    If someone out there uses directional keys what do you feel is a good key mapping setup? Let me know.

    First Person Action DEMO updated to latest build.
     
    Last edited: Aug 28, 2011
  16. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Hi ForceX...
    this version is awesome! very fast fps (few less than StandardFPSController).
    Weapon's laser pointer is a nice adding, very usefull to check the sight!
    some note:
    - Camera angle limit settings are now hided in FPS style
    - a old problem that i forgot to point out (i fix it without thinking after installing package) is that the "FX_P_Muzzle_Flash" prefab did not found his mesh and material (are Missing).

    Regards Arrow key User I think that : (my prefer FPS game settings) :
    - Delete and End are good for lean;
    - PageDown for Crouch settings (nice could be to use Mouse wheel)
    - Right Ctrl (instead to Enter) for "Action"
    - Numpad0 to jump (I'm setting it in input settings)
    - Enter (or Mouse Center) to recharge (if implemented)
    - Back Space to drop weapon (if implemented) (this could be a new idea ..pickup and drop weapon )
    Compliments!
    Max
     
    Last edited: Aug 29, 2011
  17. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Unity 3 version:

    Max
     

    Attached Files:

  18. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    I add a my test version (Unity 3 version) with some tuned effects and a free nice weapon model taken from the asset store.
    Thanks to ForceX's job and Torry for weapon model

    Max
     

    Attached Files:

    Last edited: Aug 30, 2011
  19. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    I did see now this Daily Update from yesterday
    1.It is very well organized. I like it.
    2. Perfect.

    Regards
    Max
     
  20. daywin

    daywin

    Joined:
    Jul 13, 2011
    Posts:
    9
    ForceX, Do you have plan to Make enemy For your System ?
     
  21. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Yes, however it will be part of a larger release with many more features in the future. This release will probably be put on the asset store once it completely ready. That is still a ways off.
     
    Last edited: Aug 31, 2011
  22. daywin

    daywin

    Joined:
    Jul 13, 2011
    Posts:
    9
    I try create js for check number bullets .// "cartridge_case(Clone)"==bullet?
    test by attach door .

    var damage:int;

    function OnCollisionEnter(hit:Collision)
    {
    if(hit.gameObject.name=="cartridge_case(Clone)"){
    damage++;
    Debug.Log(damage);
    }
    }
     
  23. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @ daywin. Sorry i don’t quite under stand what you are attempting to do. Do you want to check how many bullets you have remaining? Or are you trying to apply damage to an object by a prefab named "cartridge_case(Clone)"?

    1. If you want to see how many bullets you have left you can check the FX_Weapon_Linecast.js script in the inspector and look under Weapon Ammunition: There you will see "Current Shot Count", and "Total Amo Count"

    2. If you want to make an object take damage then apply the script FX_Object_Properties,js to the object and check "Is Destructible", then set the number of hit points for the object. An example would be in the Demo scene, look for an object named "Destroy Cube" Environment-->Objects-->Destroy Cube. This object can be destroyed by shooting at it.

    Because my weapon script uses Linecast / Raycast to detect and apply damage to an object and not the bullet prefab, using OnCollisionEnter will not provide any results.

    If it's none of the above can you describe again what you mean by "check number bullets"
     
  24. daywin

    daywin

    Joined:
    Jul 13, 2011
    Posts:
    9
    thank Froce X ,I will follow (2). haha I'm novice
     
  25. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Hi, ForceX,
    I found that the Prefab "FX Player" gives an error if no weapon (if no weapon is needed ) prefab is present.(1.4.0C - Unity 3.4)

    UPDATE:
    same problem just disabling "allow wapon recoil camera shake"
    (no problem in 1.4.0b)


    error:

    NullReferenceException: Object reference not set to an instance of an object
    FX_Character_Controller.SetCameraState () (at Assets/FX Game Develpoment Tools/Scripts/FX_Character_Controller.js:1124)
    FX_Character_Controller.Update () (at Assets/FX Game Develpoment Tools/Scripts/FX_Character_Controller.js:455)

    regard the error:
    - shake function is disabled in "Camera extended settings"

    other notes:
    - it could be useful to add an "Enable Prone" option (when prone status is not required) or give for crouch and prone a different keyboard key! (in this case it could be set a hold keyboard key mode instead the toggle key.)


    Regards
    Max
     
    Last edited: Sep 1, 2011
  26. daywin

    daywin

    Joined:
    Jul 13, 2011
    Posts:
    9
    i use effect destroy from detonator package. Boom Boom
     
  27. Nateao

    Nateao

    Joined:
    May 20, 2011
    Posts:
    74
    Thanks for this ,Is really good work am going to use it in my game
     
  28. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @daywin: Glad you got it to work.

    @SJM Tech: I'll get a fix for the null reference in the next daily update, Then I'll work on hold for crouch.

    @Nateao: Fantastic. Good luck on your project.
     
  29. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    perfect....good job!




    could be useful add also the ability to direct weapon (vertically) on reticule position (also for this camera mode)

    oops! I did find your old reply! Sorry

    Max
     
    Last edited: Sep 1, 2011
  30. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Hi ForceX,
    i was trying the "Weapon impact effects" system and i see that the prefab mantain the same rotation and give a repetitive effect.

    Could be a nice upgrade add a random rotation and also a random prefab's children placement. (example: random position and rotation of 3 different bullet holes)

    I hope that i don't annoy you with my criticism.
    Regards
    Max
     

    Attached Files:

  31. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update 1.4.1

    Changes:
    1. Weapon hit effects will now instantiate with a random up rotation.
    2. Each hit effect can now be assigned multiple effects. These effects will be cycled randomly.

    Fixed:
    1. When "Allow Weapon Recoil Camera Shake" is enabled, will no longer return a null reference error if there is no weapon equipped.
     
  32. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    awesome...later I will give a look!
    Thanks.

    I report to you another small thing:
    - i found (using a plane instead a sphere) that the hit effects goes a bit( Z Axis -0.02) through the hit object. (add an offset settings could be handy)

    best regards
    MAx
     
    Last edited: Sep 2, 2011
  33. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Will do.
     
  34. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Very important update.
    I post a Unity 3 fixed version: (tell me if no more needed)

    other possible improvements:
    - (FPS) add in zoom mode (RMB) a new position for weapon (aiming position).
    - (FPS) when on running move weapon in run position.
    - (FPS) add a double pressing "W" or "UP" to go directly on running mode (an alternative to "shift" pressing)
    - (FPS) o nrunning pressing Zoom(aiming) mode force player to go standard motion mode).
    - (FPS) add a smoothing bobbing camera effect after a jump (small bounce)
     

    Attached Files:

    Last edited: Sep 3, 2011
  35. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Shm Tech: LOL you sure do got a list. That's good I need these ideas. I look at it and think "Yes it went forward!! High five." Keep'em coming. Some features will go in after I have a working player model and or an inventory system. That's just a whole other thing right now, but it'll get there.
     
  36. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    I found a small issue with the new option "Hold to Crouch / Prone"
    If unchecked LeftControl key (to change status) not work anymore (it should enable toggle mode..right?) and goes on error!

    I'm sorry for my "torrential" wish lists.:D

    Regard this WIP:

    To avoid this it could add a trigger(fixed in standing position ) to the player and check collisions. On collision it force player to remain crouch/prone.
    it is only a brutal approach...but is an idea.

    Best regards
    Max
     

    Attached Files:

    Last edited: Sep 3, 2011
  37. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    I'm going to use a ray to check if there is enough room. I just need to get around to doing it along with many other things.

    Fixed stand, crouch, prone cycling in latest build 1.4.1c
     
    Last edited: Sep 4, 2011
  38. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Yes, a ray is my first thinking..but it could eat some fps...but only a test it can say... good job!

    Now the cycling works ...but the states are not aligned.( Crouching ..but says standing..ecc.).
    I'm allowed to fix this waiting your official fix.
    - Package (Unity 3).
    - FX_Character_Controller.js (Unity 3.4)
     

    Attached Files:

    Last edited: Sep 4, 2011
  39. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Wow those states have given me much grief. 1.4.1d the display state in the inspector is fixed.
     
    Last edited: Sep 4, 2011
  40. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    1.4.1e:

    New Features:
    1. Changing to a higher vertical status ie Crouch --> Standing will no longer cause the player to clip through any geometry that may be above them. Instead it will prevent the state change and keep the player in their current state until there is enough room to perform the state change.

    Updated First Person Action DEMO to latest build.
     
    Last edited: Sep 4, 2011
  41. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    wow ... nice ...but only a note ....it works only if Player is totally under the an object ; if partially under..goes inside the upper object.
     
  42. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Looking at it now.
     
    Last edited: Sep 4, 2011
  43. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    OK i think i found the (a) problem. The LayerMask that was used to check for object collisions was the camera collision LayerMask this mask excludes quite a few layers to check against. Thus some objects like the activator cubes out side the 2 sliding doors were not being included in the check. This i hope has been fixed in 1.4.1f check it out and let see if this corrects your issue. If not can you post an example of your problem?
     
    Last edited: Sep 4, 2011
  44. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Now works quite perfectly!

    Not for to be the usual troublemakers:)... but i found another thing that remain to make this function absolutly perfect.
    There is no the ability to go crouch from the prone position when there is no enough space to go standing.
     

    Attached Files:

    Last edited: Sep 4, 2011
  45. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Yea i know. I need to create indvidual key maps for each position. Thats something that will be included in a future release. And for cycle mode i will set it to check if you cannot stand to check if you can crouch.
     
  46. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    Perfect!

    another thing.... I did see that, the decal effect, (by the Weapon Impact effect system) are very good if the objects don't move...when the object hit is moving or is destructed the decal remain in the hit position. (perhaps parenting the decal to the object hit could resolve!)

    When you think to put this on asset store? I think that with few fix it is ready to be sold...it is very nice and ready for each type of use.
    I'm obviously a sure buyer!
    Best regards
    Max

    p.s. my wish list (to make it my standard fps controller):
    - walking sounds
    - climbing (ladder)
     
    Last edited: Sep 4, 2011
  47. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Decal prenting absolutly.

    Asset store release will be after i get a player stats, inventory system and perhaps an Ai. I got lots of things to work on. Thanks for your feedback in all of this.
     
  48. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update 1.4.2

    New Features:
    1. Zone_Ladder : Use Zone_Ladder's to climb up surfaces. To climb up the Zone_Ladder from a ground position approach the ladder and press forward to advance upwards. To climb down a zone_Ladder from a ground position approach the ladder (you will not be able to fall off the ladder by over walking it), turn around and press down. While on the ladder you can look around but your movement direction will be limited to the ladders vertical position. You can exit by becoming grounded again or jumping off the ladder.

    2. Zone_Teleporter: To use a teleporter enter the "Zone_Teleporter" and press the interaction key "F"

    Changes:
    1. Weapon impact decals will now parent them self's to their impacted object.
    2.HeadBob settings now exist for all active pose states.


    Setting Up A Ladder
    1. Import the object your wish to use for your ladder and place in the game world.
    2. Apply a Zone_Ladder prefab and set as a child of your ladder.
    3. Set the Zone_Ladder "Z" direction to be facing into your ladder object. (Very Important)
    4. Position the Zone_Ladder to be just in frond of your ladder object.
    5. Scale the Zone_Ladder to the height and width of your ladder object.
    6. Scale the depth of the Zone_Ladder to be big enough for your player to enter the Zone_Ladder.

    Updated First Person Action Third Person Action DEMO's to latest build.
     
    Last edited: Sep 5, 2011
  49. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    spectacular....very importants added!

    I did do a small test and all works very well!

    notes:

    - Weapon impact decals parenting:
    now is very complete!

    - Multiple HeadBob settings:
    very handy!

    - Teleporter:
    perfect .. only a small thing... "F" key works... "Enter" not yet. (only for old interactions)

    - Ladder system:
    nice.. end it works very well (for now only a test of demo scene )
    only a note... for FPS mode the best system (it is only my opinion) is to walk on the ladder
    pressing only Forward key and climb up or down simply looking to the destination point (look up to
    go up and look down to go down). For Third Personal modes actual configuration is perfect.

    Compliments
    best regards
    Max

    to best explain what i mean for FPS ladder easy sistem you can see my old project" Industrial structures" (the system works well but is too complex to set with many triggers and dirty script code... nothing to compare to yours )
     
    Last edited: Sep 5, 2011
  50. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Some how some where it seams i broke the camera collision system in this last release. A fix in in the works.