Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. 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

FX Camera Systems

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

  1. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102


    For UNITY 3.4

    (Formally known as "FX Camera System")

    Daily Build Notes 1.5.1
    New Features:
    1. Added a fatigue condition for Head Bob. Currently this is true or false and can be set in the inspector under "Current Controller State". It can be called by referencing FX_Character_Controller.IsFatigued.

    1a. This feature can be enabled / disabled under Player Settings --> Player_Motion_Settings --> HeadBob Settings --> Enable Fatigue Head Bob.

    1b. This feature has two Head Bob settings "Rested" "Fatigued"

    1c. This feature currently applies to motion states Standing, Crouch, Prone, Climbing.

    Fixed:
    1. Restored Head Bob for climbing

    Short Term WIP:
    1. Make the transitions between Head Bob state changes smoother.

    !!!!IMPORTANT!!!! Setup your layers Tags:
    LAYERS:
    8 = Ignore Camera
    9 = Ignore CameraWeapon
    10 = Ignore Weapon
    11 = Ignore Interact
    12 = Render Weapon
    13= Render GUI
    14 = Ground
    15 = Player
    16 = AI

    TAGS:
    0 = Ground
    1= Water
    3 = WaterSurface
    4 = Ladder
    5 = Activator
    6 = Door
    7 = Interactive

    FX Game Development Tools is an easy to implement system that currently consist of:
    1. Three camera / gameplay styles. (First Person Action, Third Person Action, Third Person RPG)
    2. Projectile weapon system
    3. Object interaction system
    4. Special effects properties editor

    The Camera Gameplay Styles

    First Person System:
    This is a basic first person camera setup.

    Third Person Action System:
    This camera system acts much like the camera system in most third person Action based RPG Shooters like Mass Effect. This system can use two camera locations. One for out of combat and one for in combat. The out of combat camera is placed behind and above the player actor and allows the camera to be moved in and out via the mouse wheel. The in combat camera snaps to behind and to the side aka over the shoulder view and is locked to it's current distance behind the player.

    Third Person RPG System :
    This camera system acts much like the camera systems in most modern 3D isometric RPGs like Dragon Age. The cameras rotation is controlled by holding the RMB and moving the mouse. The camera can be moved in and out by using the Mouse Wheel. The player actor can be commanded to move to a position by clicking the RMB on the ground surface.


    The Projectile Weapon System
    The projectile weapon is a raycast based solution. The system works by shooting a ray out from the center of the screen Aka the screen reticule and collecting the hit.point. The actual weapon will then orientate to look at this position. Because this creates two line of sights (camera to target and weapon to target) only the camera to target is used for projectile collision information. This leaves the weapon to target line of sight to shoot a simulated projectile towards the target. This is just a visual and has no impact on anything. Some examples would be the bootcamp demo with unity and mass effect both use this method for solving the third person line of sight offset issue.


    Object Interaction System
    The object interaction system uses an object known as an "Activator" to interact with objects in the game world. While "Activators" are currently limited to interacting with doors and lights, they will be expanded to allow interaction with any other set pieces that require a form of user interaction.


    Special Effects Editor
    The special effects editor simply allows a quick and easy way to control the way an instantiated prefab effect or projectile is handled.

    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.


    Current Features FX_Character_Controller.js
    1. Three Camera Styles
    2. Camera Occlusion
    3. Camera Orbit / Dolly
    4. Camera Zoom
    5. Change Camera (Two camera option)
    5. Dynamic Reticule Mouse Cursor

    Current Features FX_Weapon_LineCast.js
    1. Three Shooting Styles
    2. Weapon Range, Rate Of Fire, Reload Times, Damage
    3. Shot Scatter Amount
    4. Accuracy Boost
    5. Weapon Firing Effects
    6. Weapon Impact Effects



    WebPlayer DEMOS

    First Person Action DEMO
    Third Person Action DEMO
    Third Person RPG DEMO
    Isometric DEMO


    First Person Aaction Third Person Action DEMO Controls:
    Move: WSAD + Mouse
    Run: Left Shift
    Jump: Space
    Fire: LMB
    Lean Left / Right: Q , E (First Person Action Only)
    Change Pose: Left Ctrl (First Person Action Only)
    Stand Up: Z (First Person Action Only)
    Hold To Prone: V (If set to hold to enable, First Person Action Only )
    Hold To Crouch: Left Ctrl(If set to hold to enable, First Person Action Only)
    Interact: F
    Change Camera: C
    Change Fire Style: M
    Dolly Camera: Mouse Wheel (Third Person Action / RPG Only)

    Third Person RPG Controls: (Dragon Age Style)
    Move: WSAD or RMB click
    Run: Left Shift
    Orbit Camera : Hold RMB (Move mouse)
    Dolly Camera: Mouse Wheel
    Interact: RMB click




    For UNITY 3.4

    Thanks to Hovrak for inspiration in the design of the logo :)

    Internet Explorer 9 users. If you are having problems downloading files from the fourm please enable Compatibility View
     

    Attached Files:

    Last edited: Jan 29, 2013
  2. defjr

    defjr

    Joined:
    Apr 27, 2009
    Posts:
    436
    Fantastic, thanks for this!
     
  3. Ben-Massey

    Ben-Massey

    Joined:
    Jun 13, 2011
    Posts:
    581
    This is great, It was a bit of a pain that its a custom move script, that was the only let down for me but its a great package!
     
  4. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Ben4views: The current move script is really there to support the ThirdPersonRPG system. The camera script sets JumpEnabled = false, and allows a right click on the ground to move. You should be able to create your own move script and re-incorporate the MouseMove() function or wright your own. As this is the only function that is required for the ThirdPersonRPG mode.

    If you need help with anything let me know i'll try to help best i can.

    I'm not all that happy with the current move script my self so i will be focusing my attention to that next as it was really just a means to an end to get the camera system up an running.
     
    Last edited: Jul 10, 2011
  5. 95KillerZ95

    95KillerZ95

    Joined:
    May 27, 2011
    Posts:
    253
    Thanks for sharing this :)
     
  6. EmadGh

    EmadGh

    Joined:
    Jun 10, 2009
    Posts:
    144
    Thanks for sharing ! :)
     
  7. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    v1.1 Update coming soon.

    New features:
    1. Interact with objects under onscreen reticule if within a defined range. (first person third person action)
    2. Interact with objects under mouse cursor if within a defined range. ( third person rpg)

    The interaction with objects will require some coding by the programmer so the desired effect can be achieved. This is providing the means to get the object to be interacted with.

    3. (optional script) Linecast weapons with support for custom projectile effects, muzzle flash effects, impact effects, and more.

    The linecast weapon script works by shooting a ray out from the center of the screen Aka the screen reticule and collecting the hit.point. The actual weapon will then orientate to look at this position. Because this creates two line of sights (camera to target and weapon to target) only the camera to target is used for projectile collision information. This leaves the weapon to target line of sight to shoot a simulated projectile towards the target. This is just a visual and has no impact on anything. Some examples would be the bootcamp demo with unity and mass effect both use this method for solving the third person line of sight offset issue.
     
    Last edited: Jul 12, 2011
  8. okba28mca

    okba28mca

    Joined:
    Aug 22, 2010
    Posts:
    86
    Nice stuff ! good work..and thank's for sharing!!
     
  9. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    New Release v1.1

    This release mainly focuses on the linecast weapon systems "shooting". Fundamentals for object interaction have been deployed but largely have no effect ATM.

    Web Demo

    Controls:
    Move: W,S,A,D
    Jump: Space
    Run: L-Shift
    Change Camera: C
    Shoot: LMB

    New Features:
    1.Linecast weapon system
    Weapon systems include the FX_Weapon_Linecast properties editor, FX_SFX properties editor, and FX_Object_Properties editor.
    2. Foundation for Object interaction implemented.
    (Object interaction requires the FX_Object_Properties script to be on the object to be interacted with.)

    Included sound files come from soundbible.com

    Documentation will be updated on the first post in the next few days.
     
  10. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Thanks, very well made and very useful.

    It would be nice to add a walking sound different for each Object properties Type (metal, concrete, wood).
    Thanks again!
    Max
     
  11. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @SJM Tech: That's a very good idea. I'll get that included in the next release.
     
  12. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Fantastic!.
    If you want another tips i think that:
    - the name "FX Camera systems" don't give justice at your "All in one and Multi-purposes Controller" (FX Camera sound like any camera post processing effects)
    - add a reticule variation when object interactions are avaible (other reticule texture or color variation).
    -add a smoothing factor for the mouse free look (FPS)
    -add a(vertical) ladder climbing system.
    - add a crouch ability.
     
  13. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @SJM Tech: Nice list. Yes the content has out grown the name so it will be changing soon. Most of the other features will be included when I get a proper motor script written. Keep the ideas common.
     
    Last edited: Jul 26, 2011
  14. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @ Sjm Tech: I actually have a ladder climbing system from a previous fps script I was working on a while back. I will have to try to get it integrated into this package. It should work quite well for the First Person and Third Person Action portions.
     
  15. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update v1.1(3.4)

    This version is compatible with Unit 3.4.

    Resolved:
    1. Fixed warning message about out dated scripting method.

    Compatibly with 3.3 after this change is unknown.
     
    Last edited: Jul 27, 2011
  16. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Nice news..thanks!
     
  17. Llama Fragments

    Llama Fragments

    Joined:
    Dec 10, 2010
    Posts:
    28
    The camera system works great! I have a couple of suggestions for the third person shooter camera.
    -Make it so that the gun points towards what the player is aiming at.
    -I really like the way the camera goes into a first person-style view when you back the camera up into the wall, but the camera clips through the player's geometry on the way. See if you can make the capsule "fade out" as the camera moves into it.
     
  18. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Llama Fragments: Thanks for your feedback.

    1. Actor fade - I'm not sure of how to do the fade in/out in a proper way. It is something I want to look into. The current system should have the player actor mesh.renderer going into a disabled state once the camera gets so close so it won't clip. If it's clipping I'll have to check it's settings to make sure the disable distance didn't get changed to 0. I'll check this out when I get home.

    2. Weapon aim - This is something I am working on. Right now I didn't want the gun moving with a capsule as the player actor. Im working with the construction worker as the player actor to have it drive the look direction of the weapon. This way the actor will control the orientation of the weapon instead of the weapon moving independent of the actor.

    Any other ideas or comments please let me know.
     
    Last edited: Jul 28, 2011
  19. Llama Fragments

    Llama Fragments

    Joined:
    Dec 10, 2010
    Posts:
    28
    Yeah, I guess it does make sense to let the animations handle the movement of the gun.
    But here, in this example project there's a script called FadeoutLineOfSight that I used for a game a little while ago, and you could probably change the code around to fit this purpose.
     
  20. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Nice thanks for the link. I'll check it out once I get off work.
     
  21. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    New build (1.2)

    1.2 brings some new features along with some speed enhancements.

    New Features:
    1.Camera Zoom - While in FirstPersonAction or ThirdPersonAction you can use the RMB to zoom the camera in. The amount can be changed in the FX_Camera inspector.
    2.Weapons can be given a pre-defined shooting style. This will allow the weapon to only have the chosen shooting style / styles.
    3.Weapons now have a position for "Effect Round Eject" to spawn at. This position is the weapon "Chamber".
    ***4. When ever an object is set to be "Interactive" with the FX_Object_Properties it will be given the a tag of "Interactive"

    Global Changes:
    Changed all enum.ToString() == "SomeString" to enum = # . The removal of string look-ups should provide a speed benefit when ever these look-ups are called.

    FX_Camera Changes:
    1. Moved mouse input functions out of "LateUpdate" into "Update"
    2.Moved some code out of "Update" functions to "Awake" functions. This code was in the "Update" to allow for real time switching and testing of the different camera styles. As real time switching is no longer needed it has been moved to "Awake".

    WIP in this build:
    FX_Motor is undergoing some big changes. Adding framework for animation states.

    *** Changes that may not be permanent.
     
    Last edited: Jul 30, 2011
  22. Kith

    Kith

    Joined:
    Jun 12, 2011
    Posts:
    94
    I just added this to a game I'm working on. It was easy to set up and easy to use. Thank you!
     
  23. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Kith: Fantastic!! Good luck with your project.
     
  24. Kith

    Kith

    Joined:
    Jun 12, 2011
    Posts:
    94
    Thank you! If I may, I just have one suggestions. When I saw this thread at first, I was going to skip over it because the name "FX Camera Systems" made me think this was some sort of special effects package. I'm glad I opened it up and saw what it really was. I can't be the only one who would have passed this up though, so maybe you might want to add something to the title of the thread. Thank you so much for posting this!
     
    Last edited: Jul 30, 2011
  25. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    I agree the name needs to change. Unfortunately after the forum update a few months back we can no longer change the title of the post. I would have to start a new thread. Or if a moderator is out there and reading this can you let me know if this is can be done?
     
  26. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Nice update! there are bases to do the more complete Player controller for all game styles. Compliments.
    Max
     
  27. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Thanks, glad you like it. There is still much work to be done on the motor script. Plus it needs it's custom editor to tidy things up. Right now I'm working on Activators, Doors, Lights; o my.

    Activators(90%): Are objects that will allow interaction with other objects. Aka doors and lights (to start). It is essentially a toggle with some settings like auto disable and use once.

    Doors (finished): Doors interactions can be conttoled either by Activators or the door it's self. Door animations can be controlled by external animation files or by script. Scrip will allow the configuration of the doors open type (hinge, slide v, slide h), open amount, open speed, auto open, auto close, locked, and disabled.

    Lights(20%): Lights will require an Activator for user interaction. While I'm not finished with lights I plan on them having settings for once on always on, flicker till start up, constant flicker steady, constant flicker random.
     
  28. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    WRNING If importing into a project with a unity terrain in the root directory it may be over written. This will be fixed in a few hours.
     
  29. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Good job
     
  30. ForceX

    ForceX

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

    Fixes a critical potential problem with importing the package into an existing project.

    Fixes: Will no longer over-wright a unity terrain object in the root folder of an existing project if the terrain name is the default "New Terrain". The demo terrain has now been moved inside the FX Camera System folder to a new folder named "Scene".

    Apologies for any problems this may have caused. Unfortunately with out a backup of the original terrain there is no way to restore.

    If any other project integration problems arise please contact me so i can get them resolved.
     
  31. Taigo

    Taigo

    Joined:
    Feb 18, 2010
    Posts:
    128
    Hey buddy!
    thanks for sharing, it seems like a great tool.
    I just tried to import it and it gives me the error:
    Assets/FX Camera System/Scripts/FX_Weapon_Linecast.js(346,61): BCE0019: 'positon' is not a member of 'UnityEngine.Transform'. Did you mean 'position'?

    If i try to correct the word position as suggested by the console i get 29 errors so i guess there might be something there. :)
     
  32. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Hmm?? I'll have to look at it? I have not seen that error. Are you using the demo scene from the package or using your own assets?
     
  33. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    I obtain the same error only on unity 3.3.(ok on 3.4)
    To solve : edit "positon" to "position"
    Remove ",true" bolean value from each EditorGUILayout (..., ...., ...., true)(29 code lines marked as errors)

    @ForceX: i didn't found the way to increase the "Mouse Y" angle limit ( now fixed to -10 and +70)of the camera look (FPS). could you indicate me the right way? Thanks.
     
    Last edited: Aug 3, 2011
  34. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @SJM Tech: Make sure I understand you right. You are using the first person camera setup and need to change the mouse's "Y" (look up / down) limit. Did I hide those options in the FX_Camera inspector for the fps mode? I'm at work ATM and am unable to check. I'll have an answer for you in about 5 hours.
     
    Last edited: Aug 3, 2011
  35. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Yes, it is correct!

    I found a little issue on the reticule: when resizing the Game/Player window the reticule position do not remain on the center of the screen.
    to fix it I did move this two line from Function Setup() to function OnGui():
    RetSize = Vector2(Reticule.width, Reticule.height);
    RetPos = Vector2((Screen.width * .5) - (RetSize.x * .5), (Screen.height * .5) - (RetSize.y * .5));

    Regards

    max
     
  36. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Exactly. The reticule is a setup function so you are not calculating it's position every frame. My reason with that was to have it call setup during a screen size change. Of course you can update it every frame as well.
     
    Last edited: Aug 3, 2011
  37. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    I Found the way!
    I enabled the "Camera Angle Limit" hidden option (only on FPS as you said) on FXCameraEditor.. now i can I set the new values...thanks for suggestion and disponibility!
    Max
     
  38. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Sjm Tech: Yea i see that i had the Min Max hidden in first person mode. This has been fixed and now displays in all modes. I also included a simple check to see if a CachedScreenWidth is == Screen.width. If not then it will update the reticule screen position. This way it's only doing a single check each update instead of all that math.

    @Taigo: Thanks for pointing out that positon error, it's been corrected to position now. Sjm Tech is correct with your other issue. The switch to 3.4 requires a boolean to be placed at the end of an object field in a custom editor; 3.3 did not. So the funny thing is, is that the errors your are getting now in 3.3 are the errors i was getting in 3.4 after the update. You can remove the boolean value from the end of any thing like this:

    Remove the true or false.

    Look for these corrections in the next release. Thanks for your guys help.
     
  39. ForceX

    ForceX

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

    Interact Key : "E"

    Activators Doors DEMO

    New Features:
    1. Activators: Activators are objects that will allow interaction with other objects such as doors.
    2. Doors : Door interactions can be conttoled either by Activators or the door it's self. Door animations can be controlled by external animation files or by script. Scrip will allow the configuration of the doors open type (hinge, slide v, slide h), open amount, open speed, auto open, auto close, locked, and disabled.
    3. On screen reticule will update it's position when the screen resolution is changed.
    4. New Layer "Ignore Camera": Use this layer to have any object ignore the camera occlusion;

    Changes:
    1. The player camera now checks against a LayerMask "Ignore Camera" instead of the tag "Player"

    Fixes:
    1. FirstPersonAction mode now has the "Camera Angle Limit" exposed in the inspector.
    2. Corrected an error with the FX_Weapon_Linecast script. positon is now position;
     
    Last edited: Aug 4, 2011
  40. skylebones

    skylebones

    Joined:
    Nov 21, 2009
    Posts:
    106
    This is awesome! I'm not a programmer at all, but all the things I've been struggling with in my own game are right here. This has been a truly monumental help. And answered a lot of my questions.

    Now if only I can get my flashlight working. HA!

    Seriously though, I'll be bookmarking this thread.
     
  41. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    I will try to get some documentation on the usage of doors and activators up by this weekend.


    @Skylebones: Great i'm glad it is able to help you out. If you have any issues or questions with the FX scripts please ask i'll help the best i can.
     
  42. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    great! powerful and easy... thanks!
     
  43. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Update 1.3.1 (Download on first post)

    New features:
    1. Dynamic Reticule: The reticule can now have it's color texture change based on the type of object it is over.
    2. Smooth Zoom: You can now enable a smooth effect when zooming in / out.

    Changes:
    1. Global: Made many changes to the custom editors, placing relative groupings into there own fold down menus.
    2. FX_Camera: Moved disable actor renderer code out of "UpdateCameraFollowDistance()" into it's own function "DisableActorRenderer()".
    3. FX_Camera: The reticule now uses a GUITexture and references Texture for it's display type.
    4. FX_Weapon_Linecast: Changed the way Instiantiateions are called. Each Instiantiate object now has it's own function;
    5. FX_Weapon_Linecast: Is using LayerMask Ignore Camera&Weapon.
    6. LayerMask Ignore Camera has been changed to Ignore Camera&Weapon. Camera Occlusion and weapons will ignore this layer.
    7. Activators: Replaced the Door and Light "Size" field with an "Add Door / Light"buttons and "Remove Door / Light" buttons.


    Updated WebPlayer DEMO

    Controls:
    Move: WSAD + Mouse
    Jump: Space
    Fire: LMB
    Interact : E
    Change Camera : C
    Change Fire Style : X
     
    Last edited: Aug 6, 2011
  44. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Very nice upgrade! I tested only webplayer becouse i'm on vacation and in my home pc unity 3.4 goes in crash and then i use instead Unity 3.3 where there are many compiling problem (from 1.3 version) end incompatibility with "UnityEngine.Component" system. I found 21 error in console.
    Regards
    Max
     
    Last edited: Aug 6, 2011
  45. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    The errors from above i believe is because in 3.4 you can create a var of Component to be a component of an object. I don't believe this was possible to directly create a var of Component. You just had to leave the var type empty.

    Example:

    Unity 3.4 : var someComp : Component;
    Unity 3.3 : var someComp;

    This should be fixable in 3.3 by removing the "Component" after a var.

    Enjoy your vacation. :)
     
    Last edited: Aug 6, 2011
  46. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    If you change that, it will not work on mobile devices.
     
  47. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Thanks ForceX, I'm on vacation but i constantly follow this forum and the constant upgrading of your nice job!
    I know that is very difficult mantain a backward compatibility... my reply is derived by my frustration to not able to give a complete try of your update version.:)
    good job
    Max

    P.s. Yes, your tips did fix all errors
     
    Last edited: Aug 6, 2011
  48. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Dman: Can you tell me more about that. Do you mean if the "Component" declaration gets removed from the var that it will no longer work on mobile devices?
     
    Last edited: Aug 6, 2011
  49. DanielQuick

    DanielQuick

    Joined:
    Dec 31, 2010
    Posts:
    3,137
    When scripting for mobile devices, you are required to specify the type of a variable when declaring it.
    Code (csharp):
    1.  
    2. // Works
    3. var someComp : SomeComp;
    4. someComp = GetComponent (SomeComp);
    5.  
    6. // Works
    7. var someComp = GetComponent (SomeComp);
    8.  
    9. // Does not work
    10. var someComp;
    11. someComp = GetComponent (SomeComp);
    12.  
     
  50. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    @Dman: Ok. I've never written anything for the mobile platforms before so this is very good to know. Thank you.
     
unityunity