Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.


Popular Content

Showing content with the highest reputation since 03/05/2013 in all areas

  1. 133 points
  2. 70 points
    Hey guys, so I decided to make a thread about the useful scripts that are in this very useful forum. This thread will be updated regularly as soon as I (or you) find some useful scripts. If you found this helpful then leave a "like"! FORMAT: (thread name) by (author of thread) [language (C#/JS)] LIST [@DaBossTMR] Flashlight Script v2.1.1 by DaBossTMR [C#] Bullet Trajectory/Physics by DaBossTMR (credits to Jeremy Clark) [C#] Player Push (less glitchier) by DaBossTMR [C# and JS] [NGUI] Changing Screen Resolutions by DaBossTMR [C#] Top-down Shooter Camera by DaBossTMR [C#] Object Impact Sound by DaBossTMR [C# and JS] Populate Terrain Grass by DaBossTMR [C#] Realistic Camera Shake by DaBossTMR [C#] (credits go to UTnT) Find Closest Transform With Tag by DaBossTMR [C#] Disable ALT-F4 In Game by DaBossTMR [C# and JS] Extended FPS Counter by DaBossTMR [C#] [@OneManArmy] Jeremy Clark's FPS Scripts by OneManArmy [JS] RTS Camera by OneManArmy [JS] Rigidbody Controller by OneManArmy [JS] Buoyancy (Floating Objects) by OneManArmy [C#] Audio Effect When Falling by OneManArmy [JS] Cigarette Smoke Trail by OneManArmy [JS] [@OcularCash] Save/Load Method (Player Prefs) by OcularCash [JS] Health Regeneration by OcularCash [JS] Bouncing Betty/Freddy by OcularCash [JS] COD Style Cooked Grenades by OcularCash [JS] Javelin Script by OcularCash [JS] Stealth Bomber by OcularCash [JS] Harrier with Airstrike by OcularCash [JS] Anti-Spawn Trapping by OcularCash [JS] Predator Missile by OcularCash [JS] Weapon Wheel (GUI) by OcularCash [JS] MW2 Style Semtex Grenade by OcularCash [JS] Team Selection (Private Match) by OcularCash [JS] Flare Gun (with Exploding Rounds) by OcularCash [JS] Explosion (Linear Falloff Damage) by OcularCash [JS] Using Enums To Call Functions by OcularCash [JS] Basic Procedural Player + Movement + Walkable Area by OcularCash [JS] [@Duxducis404] Quake Map Loader (pk3 files) by Duxducis404 [C#] [@YoungDeveloper] Simple Teleport by YoungDeveloper [C#] [@T3kaT0kIkuTa] Particle Magnet by T3kaT0kIkuTa [C#] [@DarkChaos] Wall Avoidance by DarkChaos [JS] Disable Shadows For One Camera by DarkChaos [JS] Improved Sniper Scope System by DarkChaos [JS] Frames Per Second Counter by DarkChaos [JS] Knife Script with Animation Support by DarkChaos [JS] Countdown Timer by DarkChaos [JS] [@themars2011] Extended Timer/Counter by themars2011 [JS] Useful Networking Scripts by themars2011 [JS] Toggle Aim by themars2011 [JS] Mouse Look w/ Custom Editor by themars2011 [JS] [@bxboy15] Weapon Sway/Rotation by bxboy15 [JS] [@ProRussianMn] Save/Load Method (XML) by ProRussianMn [JS] [@jordanblythe104] Weapon Sway Script (Red Orchestra Style) by jordanblythe103 [JS] [@aeditz50] Cinematic Camera Shake by aeditz50 [C#] [@nightbird0] Smart FPS Counter by nightbird0 [C#] [@Epic-Shot] Fullscreen Video Using GUI (Pro Only) by Epic-Shot [C#] [@loftail] Zombie AI (Pro Only) by loftail [JS] [@dreadt9] Sentry Gun by dreadt9 [JS] l4mishotiz (Unity Forums) FPS Starter Scripts by l4mishotiz [uNKNOWN] [@jediaction] Peek Script by jediaction [JS] SIMPLE SCRIPTS/TOOLS Simple Tips System by pspdude [JS] Javascript to C# Converter by M2H [C# people]
  3. 39 points
    Hello guys and welcome to my showcase of our futuristic tactical action FPS game called Darkraze. Currently, it is being developed by a team of 2 people (including me) named Renegrad Studios. This game will be FREE. I will be releasing updates spanning from 1-2 weeks (or longer). You can follow these updates by clicking on Follow Topic at the top right, liking our facebook page, and subscribing to DaBossTMR on YouTube! Facebook Page: Darkraze Official Page YouTube: DaBossTMR IndieDB: Darkraze Main Update List (Changelogs and Videos): > Update #1 > Update #2 > Update #3 > Update #4 > Update #5 ---------------------------------------------------------------------------------------------------------------- ---GENERAL--- Game name: Darkraze Game genre: Tactical/Action Style FPS Main game modes: Singleplayer, multiplayer, and survival. Time Period: 2172 on a planet similar to Earth. Futuristic themed. Price: Free ---SINGLEPLAYER STORY--- Rough plot: The story takes place in 2172, when Earth's resources are nearly depleted and its once beautiful nature is now ruined. 15 years ago (2157), Project Javelin has launched a new transportation to allow transportation to nearby planets quickly (at that time) and efficiently. This has led to a discovery of Planet X. On the planet in current time, emergency deploy unit (EDU) (main character) Atlas-163 wakes up from "sleep mode" (slows down the replication and death of cells) to a code-red alert when attacked by an unknown race. Blahblahblah, the story continues from there. ---MULTIPLAYER--- Max. Players Per Server: 2-16 (may change later) Matchmaking Methods: Quick Match (searches and places you in a random match automatically) Join (join games from server list) Game modes (6): Weapons: Aiming for about 25 - 35 weapons. Maps: Scaling from small (COD) to large (BF3), 8-12 maps. ---------------------------------------------------------------------------------------------------------------- Info on the F2P game: - ABSOLUTELY NO pay-to-win items, any potential purchasable items are only used for stylistic purposes (cosmetics). STATISTICS (as of March 15th, 2015): 272 scripts, 35,500 lines of code (ALL WRITTEN BY US). Complete Uncompressed Build Size: 407 MB.
  4. 33 points
  5. 33 points
    [ Disclaimer ]: Uses Legacy Unity RakNet In order to understand how networking works, and how communicating between computers, it is useful to learn the sequence of connecting to a server. It is convenient to use one server version of each scene in a Unity project and one client version of each scene. This is useful for when you want to separate the server and client applications from each other. Connecting client and server Network Views RPC Details State Synchronization Details Authoritative Server Leave a like if you found this useful!
  6. 27 points
  7. 27 points
    Title: not decided yet In development: since 16.03.2014 Visit armedunity facebook page: https://www.facebook.com/armedunity ***** Jetpack: Update #1 (v0.3) Update #2 (v0.4) Update #3 (v0.5) Update #4 (Menu)
  8. 26 points
    Advanced Building System nDev Studios Version 1.0 Alpha Version 1.1 YOUTUBE ACCOUNT REMOVED SORRY No Videos Videos For any questions please first make sure that are not answered on the documentation and then ask me here or at devstudios@gmail.com. Thank you guys. Use it both commercial or non-commercial but Give Credits!
  9. 22 points
    Vehicle Physics. Info: So. I have noticed a lot of community members have been seeking Vehicle Physics.. I was going to create a project from scratch for the community but i have been sidetracked by my Racing Game Project ATM. So i took Andrew Gotow's Vehicle Physics & Customized - Rewrite the Code So the Vehicle Handles & Behaves Better. Has a real center of mass. Anti Roll Bars. etc. This Project Will Not Be Receiving Anymore Updates Because My Current Project is taking up a lot of my time. So I hope everyone here enjoys the projects & Makes something cool from them I will be here for support, If you have any issues / Bugs please let me know & I will be more then happy to help You out! NOTE: You are free to use this Commercially If You Replace All The Models / Sounds With Your Own. Please Do Not Upload This & Share It. If You want to share with you Friends Send Them A Link To This Thread. Features: Automatic Gearbox. Handbrake. Deceleration Speed. Anti Roll Bars. Skid marks With Smoke & Audio. Vehicle Has Max Speed. Steer Angle Is Adjustable In The Inspector. DEMO: Video Preview: Downloads. V1 : Just The Physics. https://www.mediafire.com/?kel5si16p3saxsr V2 : The Physics & First Person Controller Enter And Exit System. https://www.mediafire.com/?1i3enlz6cdhitay Downloads For 4.3. V1 : Just The Physics. https://www.mediafire.com/?vp7trxeffs3p6k3 V2 : The Physics & First Person Controller Enter And Exit System. https://www.mediafire.com/?vp7trxeffs3p6k3 Update #1 Improved The WheelAlignScript. & Made it able to handle all wheels at once. Instead of multible scripts being ran on all four wheels. How To Use The Updated Script. Step 1. Delete the WheelAlign Script. Step 2. Create a new script called WheelVisuals & Paste The Above Into The Script. Step 3. Assign This Script To The Vehicle. Step 4. Assign Your Wheel Colliders Matching The Names. & The Wheel Meshes. Step 5. Hit Play & Notice Everything still works Beautifully yet its easier to Manage. Note: "Mesh Is The Actual Wheel Model." "Wheel Is The Actual Collider" Note: SkidSmoke = SlipPrefab. Credits: OneManArmy - Enter & Exit Source From FPSKIT. Andrew Gotow - Vehicle Physics. http://www.gotow.net/andrew/blog/?page_id=78 Andrew Laverack *Epic-Shot* - Edit & Rewrite. http://armedunity.com/user/8297-epic-shot/ Angel Garcia *Edy* - Anti Roll Bar. http://forum.unity3d.com/threads/50643-How-to-make-a-physically-real-stable-car-with-WheelColliders Roylen - Easy Skid marks. http://forum.unity3d.com/members/86349-Roylen
  10. 22 points
    My gun has been released now Completely free get it herehttps://www.assetstore.unity3d.com/en/#!/content/46033
  11. 21 points
    Special thanks to DannyIsSoPro for the logo! This is similar to the "game of the year" contest, just with games made by you! The top three winners will get their topic (if there is one) pinned for one week. Until (December 31th, 2014), you must have a PLAYABLE DEMO or GAMEPLAY VIDEO OF AT LEAST 5 MINUTES (only if you are on the contestants list before registration deadline), the game has to be made in the Unity3D game engine. From the 1st January to the 4th you can vote. On the 5th we will announce both winners. VOTE FOR THEM HERE: http://armedunity.com/topic/10796-indie-game-of-armedunity-contest-2014-vote/ Current Contestants (6): themars2011 - Cold Bodies - Survival FPS - Submitted DaBossTMR - Darkraze - Tactical Action Sci-Fi FPS - Submitted ratses - Scream In The Forest - Survival Horror - Submitted Blueagardq13 - Extraction Point - Multiplayer FPS - Submitted RedCrusaderGames - Societatem - Tactical FPS - Submitted YoungDeveloper - Fantasy MMORPG - MMORPG - Submitted VOTING RULES: If you are a developer of one of these participating games, DO NOT VOTE FOR YOUR OWN OR YOU WILL BE DISQUALIFIED. Your member account must be authorized, and not a spam account that you just created during voting day. All poll results will be checked for 'consistency' Please do not vote for the person only because you like them, but instead vote for the game that YOU would most likely play. In other words, be as unbiased as possible. Jury: Some suggestions: OneManArmy DaBossTMR✔ OcularCash✔ Connor Gibson✔ DannyIsSoPro✔ willywill✔ The juries will judge the games with these critic: Gameplay: Scale from 1 - 10 PLUS Unique/Not Unique Graphics: Scale from 1 - 10 Controls: Scale from 1 - 10 Customization of settings: Optional. Additional comments... There will be two winners (most likely): Voting Winner (Popular Vote) Judge Rating Winner IMPORTANT INFO FOR THE VIDEO: DO NOT USE COPYRIGHTED MUSIC! PRIZES? The winner's topic gets pinned and can win the Ultimate Inventory from nightbird0, and also...
  12. 21 points
  13. 21 points
    Part I - Introduction _____________________ Objective: To make ones own custom image effects by the end of the tutorial. Materials: Unity Pro, Script Editor Need to Know: Must know and understand the basic functionality of scripting and how to use the Unity documents, if stuck. Shoutout: Jmaster for requesting the tutorial! Part II - The Shader First line of any shader must look like this: Shader "Custom/ShaderTutorial" { } Shader tells unity this is a shader. "Custom/xxxxx" Custom says what category the shader is located (see example below). "Custom/ShaderTutorial" This says to place "ShaderTutorial" under "Custom" category when selecting a shader. You don't need a subcategory. Its just for organization; you could essentially do it like this: Shader "ShaderTutorial" { } Next is the properties box. When creating image effects, keep in mind the only thing that needs to be in the properties box is _MainTex. We will get more in depth later. Shader "Custom/ShaderTutorial" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} //No semicolon in Properties! } } Then you have the SubShader, the actual shader location, the Pass, you can have more than one, and the CGPROGRAM. Shader "Custom/ShaderTutorial" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Pass { CGPROGRAM ENDCG } } } Subshader as stated before is the actual shaders location. It contains all Passes. Pass is the place where you can enter a CGPROGRAM. If you want multiple CGPROGRAMs you need more passes under SubShader to contain them. CGPROGRAM is the CgFx code. The Cg language adopted by Unity, made by Nvidia, supports both HLSL(High Level Shading Language) and GLSL(OpenGL Level Shading Language?) commands. You can find out more about it here: http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter01.html CGPROGRAM is where you will place the actual code for the shader in the Cg language. The language derives from C so if you know C# this is a piece of cake to understand. ENDCG just tell Unity, "Hey you can stop sending this info to the GPU now!" Now lets dive into some shader code.. Shader "Custom/ShaderTutorial" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Pass { CGPROGRAM #pragma vertex vert_img #pragma fragment frag #include "UnityCG.cginc" uniform sampler2D _MainTex; float4 frag(v2f_img i) : COLOR { float4 theScreen = tex2D(_MainTex, i.uv); return theScreen; } ENDCG } } } #pragma - you've seen this before I hope, It gives special instructions prior to the codes execution.Vertex Shader - http://en.wikipedia.org/wiki/Shader#Vertex_shaders A vertex shader for image effects just needs the screen coordinates because we're not applying this to an object we don't need an object's vertices. #pragma vertex xxxx - says, "whats the name of the vertex shader so I can find it?". The vertex shader here is "vert_img". But Wait! I dont see it anywhere in the shader!? Thats because its inside the file "UnityCG.cginc" which we have included thanks to pragma. It contains all the info we need so we don't have to worry about it. Phew Fragment/Pixel Shader - http://en.wikipedia.org/wiki/Shader#Pixel_shaders A pixel shader tells how the screen/object should be shaded. In our case we need to shade the screen which is why we arent concerned with the vertex shader and pushed it aside and used the built in "vert_img" vertex shader. #pragma frag xxxx - says, "whats the name of the fragment shader so I can find it?". Pixel shaders are nothing without a vertex shader sad but true. They need the vertex shaders information so they can begin with shading the screen. float4 frag(v2f_img i) : COLOR float4 - similar to Vector4, it contains xyzw or rgba components. Your fragment shader must be a float# (theres more but leave that for later). You put this in the front of the fragment shaders name. If you are returning a float3 it must be float3 before the name. In this case the fragment shaders name is frag. Nostalgia hitting you yet? It should because "frag" is also what we've told Unity our fragment shaders name is a few lines up in #pragma fragment frag. (v2f_img x) - ignore the x for now. Also located in "UnityCG.cginc". It is the name of a struct that contains the vertex program "vert_img". (v2f_img i) - Ok back to the variable i. "i" is the variable for accessing the struct. You must have one but you can name it what you like. Ex. (v2f_img myvariable). xxx : COLOR - This is called a semantic. It says, "Hey, what type of info is this?". Funny though because you can name it almost anything below but keep it COLOR. Semantic Types http://msdn.microsoft.com/en-us/library/windows/desktop/bb509647(v=vs.85).aspx uniform sampler2D _MainTex; float4 frag(v2f_img i) : COLOR { float4 theScreen = tex2D(_MainTex, i.uv); return theScreen; } uniform sampler2D _MainTex - samples the screen as a texture. Or to simplify, takes a screenshot of the current screen and places it in your shader as a 2D texture. float4 theScreen is a new variable called the screen that holds 4 components, rgba or anything else but lets focus on rgba. theScreen = tex2D(sampler2D, coordinates). The sampler2D is the main image or _MainTex. The coordinates it will use are the screen coordinates, which we take from the vertex struct v2f_img and access the uv components by saying "i.uv". http://msdn.microsoft.com/en-us/library/windows/desktop/bb509677(v=vs.85).aspx We then return the screen in its original state but of course lets modify it! Lets take the red component of the main image and amplify it! float4 theScreen = tex2D(_MainTex, i.uv); theScreen.r += 0.5f; return theScreen; This takes the red component only of the screen and adds 0.5 to it. It should turn out more red once we finish. But we should make the value of redness changeable in the inspector. Lets do it.. Shader "Custom/ShaderTutorial" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Pass { CGPROGRAM #pragma vertex vert_img #pragma fragment frag #include "UnityCG.cginc" uniform sampler2D _MainTex; uniform float _Redness; float4 frag(v2f_img i) : COLOR { float4 theScreen = tex2D(_MainTex, i.uv); theScreen.r += _Redness; return theScreen; } ENDCG } } } I've added a variable _Redness that will let me control the redness once we get to the script you will see. Part III - CSharp and RenderTextures I won't go into too much detail but here is the basic script for rendering Image effects. using UnityEngine; using System.Collections; [ExecuteInEditMode] //See changes in realtime public class ShaderName : MonoBehaviour { #region Variables public Shader CustomShader; public float Redness = 1.0f; private Material curMaterial; #endregion #region Properties Material material { get { if(curMaterial == null) { curMaterial = new Material(CustomShader); curMaterial.hideFlags = HideFlags.HideAndDontSave; } return curMaterial; } } #endregion // Use this for initialization void Start () { if(!SystemInfo.supportsImageEffects) { enabled = false; return; } } void OnRenderImage (RenderTexture sourceTexture, RenderTexture destTexture) //sourceTexture is the source texture, destTexture is the final image that gets to the screen { if(CustomShader != null) { material.SetFloat("_Redness", Redness); //Links the shader value to the C# value so it can be updated at anytime in the Inspector Graphics.Blit(sourceTexture, destTexture, material); //Draws a full screen texture to be displayed with the material named "material" which also has the shader attached to it (See line 19) } else { Graphics.Blit(sourceTexture, destTexture); //If the computer doesnt support Image effects or cant run the effect just use the main image without a material applied } } // Update is called once per frame void Update () { Redness = Mathf.Clamp(Redness, 0.0f, 1.0f);//Clamp values in here to keep things from going overboard and you can't get bigger than 1.0 unless HDR is used on the render texture format } //When we disable or delete the effect..... void OnDisable () { if(curMaterial) { DestroyImmediate(curMaterial); //Destroys the material when not used so it won't cause leaks } } } Now we have an image effect that lets us control the values of redness in the inspector. Time to red this up Part IV - Conclusion After attaching the script to a camera and changing its name inside and outside the cs file to anything you want, apply the shader to the CustomShader slot. You can name the shader anything, it doesn't have to be the same as it was in the code. And thats all. Make up your own task. Challenge yourself and see what you can do with this newly acquired knowledge. Before and After screens: Before After
  14. 19 points
    Welcome, to a very long tutorial on how to make your Unity3D games look "better". I say "better" because not everyone's art styles appeases to realism and I will respect anyone's artistic style here. Now this post will cover the following topics and will be updated on a day-to-day basis so make sure to stop by and read up on the updates. The Unity Pro related topics will be highlighted with PRO next to them. Directional Lighting Ambient Lighting Global Illumination H.D.R. Tonemapping Bloom Image Processing Reflections Textures Anti-Aliasing Translucency Miscellaneous Materials Physically-Based Rendering Alright, so these topics will not be typed up in any particular order. The first topic I will cover will be an easy one, which is directional lighting. Directional Lighting in Unity3D is simply a light vector in 3D space, more specifically in world space, disregarding shadows, that cast lighting on all objects. This form of lighting is approximated with the function NdotL, or the dot product between the light vector and the normal of the objects. Where θ is the angle between them known as the angle of incidence. Without using the cosine function, we discovered the dot products of these two vectors are equal to the cos(θ). This NdotL is a very cheap approximation of subsurface scattering, also known as diffuse. Diffuse meaning scatter or spread. It is a way to account for the Sun and is often tinted with a light color to give artist freedom in what color the "Sun" is. This is commonly known in video games as Lambertian shading. It can be coded as such (Cg) : //pseudo code float3 NormalVector = normalize(NormalVecFromVertexShader); //normalize means to make all the vectors a unit length of 1 float3 LightVector = if you're using Forward Rendering - normalize(_WorldSpaceLightPos0.xyz); if you're using Deferred Rendering - normalize(-_LightDir.xyz); float3 NdotL = max(0.0f, dot(NormalVector, LightVector)); //Can't have less than no light being reflected on a surface. so at most no light. With a "Sun" in our games giving us an approximation to diffuse lighting, it also gives us the opportunity to create shadows. Shadows are a crucial part in video games. You are allotted 1 Directional Light with Hard Shadows in Unity Free so make sure your taking advantage of the opportunity! Example of Directional Lighting: Attenuation is the gradual loss in intensity of any kind of flux through a medium. The way Unity attenuates light is based somewhat off of the typical approach in 3D games and not a physical approach. See [physically based rendering] to see how we can get a far more physically-based results using the Inverse Square Law. Now, enough of the physics and math, with this we will figure how we can use the knowledge to our advantage. As you may already know, you can fake ambient light using multiple directional lights. This will lead us into our next topic, ambient lighting. Ambient Lighting in the simplest terms is everything that's not directional lighting. Ambient lighting in the real world is what is known as global illumination where every surface absorbs, (diffuse global illumination), obscures, (ambient occlusion), reflects, and/or refracts light (specular global illumination). In video games, it is common to use a constant color as ambient lighting. Its easier! Rather than calculating some expensive GI you just say that entire scene has a blue ambient color. But, there are better ways to solve for ambient lighting in ways that are much more accurate. [All pertaining to the first image inside the example] Notice the occlusion, and the absorption of the ambient lighting. There isn't very much reflection or refraction going on. When it's reflected or refracted the objects would be shiny. I will show a comparison. For now take note of the following. Ambient occlusion only exist within ambient light The diffuse term of the ambient light is not a constant color There is not ambient specular lighting within this scene Example of Ambient Lighting: AMBIENT LIGHTING IS KEY TO A GREAT LOOKING GAME! Far Cry 3 for example uses an excellent ambient lighting system that I highly recommend you all check out. Now, the question is how do I get better ambient lighting? How do I replace Unity's crap of an ambient lighting system (that will be replace in Unity 5 )? Many many ways. Very small filtered or blurred cubemaps for example a 4x4 size cubemap. You can take these cubemaps in Photoshop and paint them how you please. Get creative! Hemispherical Ambient Lighting. Use fake lighting vectors multiplied by an attenuation term which is what I use in conjunction with cubemaps. Spherical Harmonics although this one isn't practical in real-time just yet. Importance Sampling, what Unreal Engine 4 uses to filter cubemaps, what I will be using in the future. Global Illumination techniques Light Probes I will give a quick tutorial on Hemispherical Ambient Lighting based from this article here: http://devlog-martinsh.blogspot.com/2011/08/simple-and-efficient-skylight-setup.html Sky light for simple reasons can just be computed as the dot product between the down vector and the normals of the surface, multiplied by a sky color and sky intensity value. PRO It's best to apply this to all objects in the scene, you can do this via post process by using sampler2D _CameraDepthNormals or by adding it into the deferred rendering and applying it to the global normals there. float3 SkyLightVector = float3(0.0, -1.0, 0.0); //Fake light pointing down float3 GroundVector = float3(0.0, 1.0, 0.0); //Fake light pointing up float3 BouncedLightVector = -LightDirection; //Opposite of the light direction float3 _SkyColor; // - passed in from via script float SkyIntensity; //The others are very similar, just replace SkyLightVector below with the others and multiply by separate colors and intensities float3 SkyLighting = dot(normals, SkyLightVector) * SkyIntensity * _SkyColor; float3 ImageBasedLighting = SkyLight + GroundLight + BouncedLight; ImageBasedLighting *= AttenuationTerm; // This can be halflambert like in the reference or any other attenuation term ImageBasedLighting /= PI; //See below why we divide by PI We divide by PI at the end for Physically-based reasons. I called it image-based lighting because I was lazy and copied and pasted Read this here - http://seblagarde.wordpress.com/2012/01/08/pi-or-not-to-pi-in-game-lighting-equation/ - and check out the [ physically based rendering] section as well. I will probably come back to this because ambient lighting is a very in-depth topic but my internet connection being throttled. [stop Tom Wheeler, save the internet!] Directional + Ambient Diffuse
  15. 17 points
    Hey guys! I would like to show you our new asset, which has been published just a day ago. As you can see in the title, Quantic is an advanced character controller solution for any first-person game. Featuring multiple movement types, such as traditional first-person movement, realistic zero gravity movement, and free-roam spectator style movement as well. It is a really smooth, gravity and state based character controller system with dynamic footstep sound, and head bobbing mechanics as well. We also give you a total of 12 high quality footstep sounds! It is 100% game ready, you can just drag and drop the character into the game and you are good to go! No programming required at all! Don't worry, we also thought about experienced developers, so we made a state system which you can use to get every information related to the character. With this system in place, you can extend the controller with ease and without limits. Here is the Asset Store page: https://www.assetstore.unity3d.com/en/#!/content/86326 I know that you came for the giveaway so lets talk about that. As a contribution for the community I will be giving away 5 copies of the asset, which is worth $100. If you want to participate in the giveaway you have to do the following steps: You have to have at least 20 posts on the forums. Like this post, I don't know... just why not! Leave a comment under this post. Hope for the best! The winners will be selected on April 16, 2017 by a script in Unity just to make it more fun! Good luck everyone, and have a nice day!
  16. 17 points
    Download me. If you have any questions, just ask. Please leave some feedback
  17. 17 points
    Added New pause menu Added Weapons Menu Added Run system Added Simple air atack system Added Auto Reload system Added crosshair disappearing when running system
  18. 17 points
    Q. How to use this script? A. Just drop this script on root of your weapon GO and adjust all parameters in Inspector. var amount : float = 0.02; var maxAmount : float = 0.03; var smooth : float = 3; private var def : Vector3; function Start (){ def = transform.localPosition; } function Update (){ var factorX : float = -Input.GetAxis("Mouse X") * amount; var factorY : float = -Input.GetAxis("Mouse Y") * amount; factorX = Mathf.Clamp(factorX, -maxAmount, maxAmount); factorY = Mathf.Clamp(factorY, -maxAmount, maxAmount); var Final : Vector3 = new Vector3(def.x+factorX, def.y+factorY, def.z); transform.localPosition = Vector3.Lerp(transform.localPosition, Final, Time.deltaTime * smooth); }
  19. 17 points
    This doesn't include any models, just universal animations for movement of weapons. The pack includes Idle (Not Moving), Walk, Run With Scoped Weapon "LongRun", Run With Non Scoped Weapon "Medium Run" And Run With Pistol "ShortRun". Here's a preview of the idle, walk and scoped weapon run: https://www.youtube.com/watch?v=CJPS-7FVKc8&feature=youtu.be To use, just create an empty gameobject and place it as a child of the weapon camera (or anywhere under the weapon camera) and zero out the position and rotation. Then move everything that is parented to the same object to under the new gameobject. Place an Animation component on the new gameobject and drop the animations onto it. Easy as that. Animations.zip
  20. 17 points
    This small building enterable. I hope you like it Licene: Commercial Use Donwload: https://mega.co.nz/#!74wggR6C!ARjNa9hdozQYm--uNYWlg5QGjYW1Oz1smI54_UzzE6c PS: Unity generated the normalmap badly. Sorry about it.
  21. 17 points
    Hey Guys! I now have another shader to showcase and release soon, my ocean shader! This shader Is sort of based on Martians water shader but of course its mainly different from his. Anyways me and willywill have been making some shaders together as a collaboration and this is one of them. Anyways now the Screen shots!!! V1 (Main Shader, With Fresnel, Specular, Reflections, Color (Lerped with Shallow Water Color), And Waves 1. https://www.dropbox.com/s/tbpljh6w7dmrchi/Screenshot%202014-04-11%2022.50.55.png 2. https://www.dropbox.com/s/24kf4olnr3c0mq0/Screenshot%202014-04-11%2022.51.08.png 3. https://www.dropbox.com/s/gvhbkmjsbzaujq3/Screenshot%202014-04-11%2022.51.27.png 4. https://www.dropbox.com/s/gxy4h17icwtigag/Screenshot%202014-04-11%2022.53.33.png V2 (Vertex Displacement Implemented) 1. https://www.dropbox.com/s/6mwyaeskj6lpzth/Screenshot%202014-04-12%2012.26.21.png 2. https://www.dropbox.com/s/r2xaqd06v0e3xhy/Screenshot%202014-04-12%2012.27.45.png 3. https://www.dropbox.com/s/vlfs9exd9z8nkie/Screenshot%202014-04-12%2012.28.06.png 4. https://www.dropbox.com/s/2ceptclltwh9rp2/Screenshot%202014-04-12%2014.07.06.png V3 (Foam) 1. https://www.dropbox.com/s/32qvvwodi5y7ma0/Screenshot%202014-04-12%2016.01.54.png 2. https://www.dropbox.com/s/94wrwjp4vwe3a8q/Screenshot%202014-04-12%2016.03.25.png 3. https://www.dropbox.com/s/1g4ivlc3hihkel5/Screenshot%202014-04-12%2016.03.49.png 4. https://www.dropbox.com/s/ws17hhlv6t6k2qc/Screenshot%202014-04-12%2016.04.29.png V4 (New Fresnel) 1. https://www.dropbox.com/s/skqzlm44bomlw7p/Screenshot%202014-05-06%2015.25.37.png 2. https://www.dropbox.com/s/4vigan7led0kvml/Screenshot%202014-05-06%2015.26.12.png 3. https://www.dropbox.com/s/0pxqyl1maq9kifb/Screenshot%202014-05-06%2015.27.32.png 4. https://www.dropbox.com/s/k4dfq2pi4ja1jq5/Screenshot%202014-05-06%2015.27.55.png V4 Download - https://www.dropbox.com/s/g9vs7hqqt8alz0u/water.unitypackage NOTE: Keep the ocean prefab position coords at 0 0 0, if you want to move it, move it very slightly otherwise it will disappear, this is an issue with the vertex displacement Anyways The ocean shader is still a WIP and is far from finished, but so far it looks really good (in my opinon). Yet To Do - Physically Based Specular - Depth Fog - Sub Surface Scattering - Improve the Fresnel Term (Done) - Use a BDRF model (Working) Known Bugs - Specular isn't Facing to the Light Dir Correctly For this to work you must have a card that supports SM3.0 or Higher. And will not work with DX11 enabled, sorry If your going to use this in a commercial project, be sure to credit me So anyways What do you guys think? Best Regards, Frosty5
  22. 17 points
    Ocean with BRDF lighting. https://www.youtube.com/watch?v=cRWCLF9Mi68 Information and download link you can find here: http://scrawkblog.com/2013/06/04/ocean-with-brdf-lighting-in-unity/
  23. 16 points
    Hi guys! I updated the Horror Kit and this is the result: IMPORTANT: - GIVE CREDITS TO MasterDevelopers - I MADE THE PROJECT USING UNITY 4.6.1 PRO VERSION Tell me what do you think
  24. 16 points
    NEW PACKAGE! This one is a bit late but sure was worth the wait I guess. It's a new pair of FPS Arms which you can use without crediting anyone from this site! It was made by me, and can be used ROYALTY FREE! Feel free to use it in whatever project you like! Please read the text file in the package before proceeding after download! Thanks! Download! Image: ___________________________________________________________________________ Original Post here at my website: 7XFGAMES
  25. 16 points
  26. 16 points
    KICKSTARTER IS NOW LIVE! https://www.kickstarter.com/projects/1726296933/downfall-of-the-state-open-world-strategic-shooter I posted my attempt at this game a long while back but I hit a dead end as I didn't want to follow through with yet another zombie survival game. After copious amounts of caffeine I decided to branch out the familiar theme of an FPS/TPS game with elements of strategy, exploration and a huge variety of classes to cater for anybodies play style (RPG, Run and Gun, Tactical etc.). Whilst the following youtube clip doesn't show any elements of the open world dynamic military base capture system I wanted the video to act merely as a teaser. It's primarily an FPS game with a large chunk of strategy involved, the main concept is that the Middle East is about to collapse and forces across the world are attempting to claim land as their own. The player's job is to either liberate regions of the middle east or conversely create an empire of their own ranging from Northern Africa all the way to Siberia. The player starts in the Middle East and can conquest in any direction they wish and as they go along they must loot resources in order to equip their army although the loot can be invested in mercenary disciplines (where the player can play more like a lone wolf) or military disciplines which will aid the army as a whole. Please support my greenlight: http://steamcommunity.com/sharedfiles/filedetails/?id=544095552 (HAS BEEN GREENLIT) LATEST UPDATE [29/03/16] - [YouTube Videos] : [screenshot Showcase] :
  27. 16 points
    This is a very inspector-configurable spawn system, which is executed in waves. Reduces additional programming to minimum if you are happy with features it comes with. Everything is randomly chosen and randomly spawned from current wave settings, so enemy spawning does not feel linear. You can: Set any amount of spawn points, and set/ change delay effect on it Set any amount of enemy types, set preferred spawn points for each of them, spawn ratio (per wave), and should that enemy be spawned from beginning or specific wave call Set specific events for specific waves, for example boss enemy/wave at wave 5 and 10 (in my example) You can set specific spawn points for specific enemies, so you could have specific enemies coming from certain areas (like flying, or wall crawling enemies) Certain spawn point can be locked and unlocked You can easily add any type of enemies via inspector, you could almost achieve same effect as in cod zombies in couple minutes Demo Move using AWSD, enemies are killed when you touch them. Play till level 10, so you would understand how it works. Spawn Manager script As it would be pretty confusing to set up, i am giving the whole project which shown in demo above. Download: Spawning.rar
  28. 16 points
    This is something like a sample model for the pack im working on right now. If everything is cool it will be on AssetStore soon. I was kinda out from modeling / game developing, but im gonna share you my latest work. The idea was something like a city block where some survivors tryed to make this place safe. Im used seamless textures for better resolution, and also tryed to optimized the mesh. Download Verts: 2710 Faces: 1587 Tris: 3598
  29. 16 points
    The FPSKIT Multiplayer v1.2_0.3MP A biiiiiiiiiiiiiiiiiiiiiiiiig update for everyone. Tutorial about how to add a weapon coming out soon. A Serverlist! A Chat! Killmessages! shooting over network works You have a server list your own playername, level and total score (works over playerprefs) a chat kill messages in chat join message in chat cars and helicopter do now work but you cannot be seen driving on the network i uploaded it on Mega DOWNLOAD GAME(Windows only): https://mega.co.nz/#!2M43SRYa!TLbMb0Ha8bLXebEjMUcdjBzGD7BMWn10iZWGYmzKCGE DOWNLOAD SOURCE: https://mega.co.nz/#!2EQjhKDY!PBDpj0fd7PsuZuarxC4lnBphfZYt3_LwVy7DdO_vn6A WEBPLAYER DEMO: -uploading- extra controlls: G - Spawns a Zombie H - Spawns a Beast J - Spawns a Giant Beast V - Removes all enemys spawned and death how to edit the player? the player is in the root of the project as a prefab. insert it into the scene. edit it and press in the root of the player on apply in the inspector. if youre finished, remove the player from the scene. You need Unity 4 to edit the project. If you make the game public, you have to credit me(pokeyoshi3) or pixel studios(my team). old release: Want to support me for free? click here: http://adf.ly/1c4eR (click on skip ad, you will be redirected to my Youtube channel)
  30. 15 points

    Version 1.6


    Requires unity 5.6.3 or higher. In unity 5 you will have to rebuild the lighting data. In unity 2018.3 you will get MinAttribute error. To fix this error, open MinDrawer script and add following line at the top: using MinAttribute = UnityEngine.PostProcessing.MinAttribute; Also you will have to rebuild the lighting data. *************************** VIDEO TUTORIALS * How to open project: * How to add animated weapon: * How to add weapon by replacing model
  31. 15 points
    FPS Kit v1.4.0a With One Man Army and myself having our own projects to work on and very little time to work on Kit Updates, I've decided to show you the progress on the newest version of the Free Kit and let you test it out with a downloadable player. This way you can test out the features without having multiple browsers open. As you've figured out by now, yes, multiplayer has been added upon several requests for such. Also, a simple weapon selection menu has been added to give you a start for your weapon managing needs. Check below for updated list of bugs. Build x86 DOWNLOAD Build x86_64 DOWNLOAD Project Files DOWNLOAD FPS Kit v1.4.0b Beta version will be released at a later date. The beta version will include fixes from alpha, vehicles and much more. Check back in the future for release dates. FPS Kit v1.4.0 Full version will be released after beta testing. The full version will include all fixes from alpha and beta. Check back in the future for release dates. Current Bugs Dead Replacements show up if exiting and re entering a server (will be fixed in beta version) If a server closes, the scene players are not removed (Easy fix, but will be fixed in beta version) Weapon does not show on other players in your scene (will be fixed in beta version) How To's PLAYER MESH SWAP : https://www.youtube.com/watch?v=XlRaZhjomuI Demo: https://dl.dropboxusercontent.com/u/230875276/Preview/Preview.html
  32. 15 points
    [COOP will be added when uNet is released!] Hello guys and welcome to the showcase of my coop survival FPS game called Cold Bodies. It's currently developed by Mars Industries which consists of 10 team members currently. Updates will be released unregulary, but atleast 1 per 8 weeks. You can follow the Updates by Following the topic (Look at the top right) or subscribing my Channel. Website: http://coldbodies.info/ YouTube: Mars Industries Facebook: ColdBodiesOfficial Indiedb (team): Mars Industries Indiedb (game): Cold Bodies Updates: Sorted: Oldest - Newest ---2014 DEVELOPMENT--- Update #1 Teaser #1 Small Update (HUD) M98B Model Preview Update #2 Update #3 Player Reflections [Akimbo Guns in Testing Project] Devlog #1 (Bombs) Devlog #2 (ArmA style action menu, timed bombs) --From now on only hyperlinks because of some limit-- Info Video (Ryts Holm Airport showcase) Zombie AI Showcase Update #4 Survivor AI #1 Survivor AI #2 Revolver WIP 1 Revolver WIP 2 Revolver WIP 3 + M98B WIP 1 Mark 1 new animations [WIP 1 + 2] OST Track 1 - Exploration 1 M4A1 WIP 1 Update #5 ---2015 DEVELOPMENT--- Destroyable Barrier [Happy new year 2015!] DirectX 11 Features [Tesselletion Displacement] ArmA style ammo system [integrated in inventory] Crafting OST Track 2 - The Laboratories Squad AI first test Screenshots: ---GENERAL STUFF--- Name: Cold Bodies Genre: Singleplayer Survival FPS Time Period: 2014 Price: Not decided yet ---STORY--- Secret, for now I can only say it has something to do with Rabies. ---TEAM--- ---Donations--- Want to donate? Donators: paccione Zhavier mike123
  33. 15 points
    Hey guys, Here's some exciting news for those who want a FPS project for free, besides the nice FPS kit. It could be helpful for those who want this. Here's the link to the asset store: https://www.assetstore.unity3d.com/#/content/2561 This is the creator's message: All I can say for now. Have fun with it! Message from Blockfighter298 P.S. Oh yeah, and if you don't mind. A like/vote-up would be great, thanks.
  34. 14 points
    First of all, Thanx to TheMars2011, its he who instructing me how to add multiplayer, and thanx to pokeyoshi for his multiplayer scripts. --------- Features: -Buttons now auto resizable for any resolution! -New Menu music (created special for mp release) -Multilanguage -Map selecting -Many fun Download: http://deatrocker.ucoz.com/news/multiplayer_mobile_fpskit_by_deatrocker_free_download_unity3d/2013-08-01-151
  35. 14 points
    Hey guys, some of you may know i'm making an ak12. Right now working on the high poly, also practicing my rendering skills in blender. So everything shown here is made in blender and cycles so far. New Renders; Hope you enjoy Sorry for noise ;/ Will be releasing likely on the asset store, for the grand total of 0 dollars. So free... Feedback and a like always appreciated , although serious feedback I would prefer on polycount forums instead of here, shouldn't be too hard to find there in the 3d section. Will be making a post there shortly.
  36. 14 points
    UNITY3D NOOB TO PRO SERIES COLLECTION So I'm starting this new forum "series" to allow the community to answer some of the most frequently asked questions and (some of my own) in the most simple terms; for comprehensiveness sake. SHORTCUTS: What is a Shader? Best Answer What is a Prefab? Best Answer What is RayCast? Best Answer What is a RigidBody? Best Answer What is a GameObject? Best Answer What is an .FBX file & How is it different to other formats? Best Answer What is Lightmapping & How do you apply it? Best Answer What is NavMesh? Best Answer What is Occlusion Culling? Best Answer What is a Light Probe? Best Answer How do you create & implement a script, so that, when you collect a gameobject a message appears? ANSWER NOW! RULES: 1) Please, do NOT use this post for general discussion, provide quick, clear and in-depth answers. 2) Please, do NOT answer by telling us to look at the manual or watch a video. Each thread is supposed to answer their question and fill that gap in their knowledge and not to be insulted by their fellow community. 3) To win; you must provide a fully featured, helpful answer. 4) Good Luck & Have Fun! PRIZE: The winner shall get +1 rep and their answer shall be chosen as best answer. So today's NOOB to PRO question is: Today's question has closed. See who won and come back in a few minutes for the new question! ----- Meanwhile, give our thread a +1 if you enjoy it! -----
  37. 13 points
    Note: this is not MINE, but I've come across it quite a few times, thought I'd share! https://github.com/staffantan/unityglitch
  38. 13 points
    My second release of the day. This one is a keeper. I thought to myself, there are NO simplistic, easy to understand, yet findable ADS scripts for beginners out there. So I thought hell, it's time to contribute a really nice piece to the community. This is a nicely featured ADS script which uses FOV to zoom and the weapon coordinates are retrieved via transform. Now time to explain how to install the ADS script. [instructions to setup] Step 1: Drag the script to your weapon game object. Step 2: Within the 'Main Camera' slot, drag your weapon camera or your main camera there, depending on your FPS setup. Step 3: Set up the FOV variables and smoothing to your liking, and even then integrate to your weapon system if you wish. Step 4: Place the weapon in front of the camera to your liking, then take the weapon's X, Y, and Z and copy them into the default hip position slot in your inspector. Then do the same with the aim position, pretty simple huh? Step 5: Finally, set the smooth aim variable to your liking, and you're all set! Step 6: Enjoy.
  39. 13 points
    Day/Night system with color blend and dynamic fog system.
  40. 13 points
    Another enterable building for AbandonedCity pack. This is a shop but also good for a house. I hope you like it [Door Seperated] License: Commercial Use Donwload: https://mega.co.nz/#!zlIjlKSL!P-l0Nu5Kn6NgvVVAiNuez4CZlLsIUhidQfF1WJ6OfEA
  41. 13 points
    I don't even think I need to go over why I had to do this. But say hello to no more noise shadows! Requires Unity Pro! Just place this file inside a folder named "Resources" and restart Unity. If you want to greatly increase the shadow spread change the spread value indicated within the shader. Its still a WIP! File: https://www.dropbox.com/s/6ojaxym9bvq9e2k/Shadow-ScreenBlurRotated.shader Shader code:
  42. 13 points
    NEW PACKAGE! It is a map props package this time! Working on an FPS? TPS? RPG? And don't have the necessary models to make your map look EXTRAORDINARY? Well this package can help you out! It contains a few but good looking assets that will surely lighten your map up a bit with realism! This package contains 2 kinds of barrels, some crates, a metal door, some rusty railings, and 2 garbage bags WHICH you can duplicate and modify! Download! IMAGE:
  43. 13 points
    I had been creating a Unity FPS game for a while and I thinks it is time to share my progress. Version #1: Version #2: Credits: CSS: Map De_Dust2, Weapon Models/TexturesChaos: Animations, Scripts, Graphics
  44. 12 points
    *This kit is no longer supported* Hello ArmedUnity! I’ve made my first FPS Kit for you and me! It helps me to improve my current knowledge, playing around with code, making new systems.. etc. While Im learning I want you guys to use and improve my progress. You are free to make a game with this! But you will need to change every model! This is completely made from scratch! Even the FPS Controller! I hope I will get some feedback for it. Helps me improve this kit and my knowledge! This Kit will get Daily or Weekly updates! Description: FPS Controller Simple { Crouching, Jumping, Sprinting, Walking } Can Crouch detection under Objects Animated Legs PLACEHOLDER Player Simple Weapon Script Weaponswitching Weapon Drop Rigidbody dragging Simple UI Simple Wallrun Simple Ladder Climbing Simple Parkour Middle Level AI AI search for cover when attacking player AI search for cover that AI is safe AI search for nearest cover AI Weapon Script AI Weapon Reload AI Wandering Script AI Text on head (only visible if player looks at AI) and more! Update 2: Added Sprinting animation Added Pickup animation Improved Parkour Improved Ladder Climbing Improved Legs Fixed Bugs Added 3 Demo Scenes Added Main Menu Added Load Level OnTrigger Script Update 3: Added Simple UI Fixed shooting while running Updated Weapon Drag script Added smooth crouching Commented 50% of the code Added tooltips Update 4: Performance Update 1: Fixed Bugs Fixed Some Errors Added PauseMenu Edited MainMenu (Added Control info for now, next will be editable controls) Updated Weapon Script Updated Player Script Updated MainMenu Script Updated Player Canvas Updated Scenes Removed Several Models, Textures Edited Texture Quality and much more... Update 5: Performance Update 2 Fixed Bugs/Glitches Fixed Errros New Parkour Animation New Jump Animation New Middle Level AI New Gun Models New Gun Animations New Sounds New Ambient Sound New Leg Textures Added Animated AI Added Ammo Pickup Added Drag Collision Detection Added Camera Movement Updated FPS Controller Updated MadPlayer to be more effective Updated Demo Scene Removed 2 Scenes Removed Old Weapons Removed Old Sounds and more.. Update 6: Completly New Version Changelog coming soon.. To-Do: Making code cleaner New Weapons (Explosive) Work on wall running and more... Trello: https://trello.com/c/5g4Zzjyl/7-mad-fps-kit Please give me suggestions of what I could add. Unity version: Unity2017.3.1f or higher. File Name: MadFPSKitV0.9.rar File Size: 553.06MB Download Link: http://www.mediafire.com/file/y916as7a3grm9y1/MadFPSKit0.9.rar/file .EXE Demo Version Link: -- Showcase/Update Videos: Tutorial Videos: Happy Developing! MadWolf Games
  45. 12 points
    Hello there! Paxitium is a work-in-progress survival game set in the early 1900s. Facing obstacles ranging from natural needs such as hunger and thirst to dangerous wildlife and unfriendly human NPCs, the player must choose a role and survive in the wilderness. Eventually through venturing multiple neighboring islands, the player is able to discover numerous clues related to the background of the world they are in. Basic gameplay will include construction of structures for protection from enemies, looting items from abandoned towns, and more. Cooperation between players is highly encouraged, and the servers will offer extensive customization to settings such as PvP/PvE, day cycle length, difficulty of AI, and much more, to create a fresh experience for players. Everything that you see within these update videos are highly work-in-progress unless stated otherwise. Constructive criticism will also be highly appreciated. Update #4: Update #3: More info: IndieDB: http://www.indiedb.com/games/paxitium Discord: https://discord.gg/wFRbT4G Facebook: https://www.facebook.com/LutonStudiosDev Twitter: https://www.twitter.com/LutonStudiosDev
  46. 12 points
  47. 12 points
    Your fans? I think, because of you i must add also hater list
  48. 12 points
    After this thread www.armedunity.com/topic/6720-simple-coin-collection-system-c-js/#entry57703 i understand'ed why pretty much i have not seen any project here with large item data structures. Mostly couple pickable objects which are found using tag or name. Before writing an actual code, i would like talk about couple things, like what is overall basic idea from game creation perspective itself. Map designers, quest creators and many others, these people mostly never code when creating maps, quests, place npc etc. They have ready custom built tools for doing that, all what they do is move sliders, search through lists and place/write (not code). So, before actually creating the game experience itself, we need to make sure that we the right tools for doing that process, it will be taking a long time to create the map, so each helpful thing for the map designers can save tens of hours. One way would be storing ready prefabs in one folder, but imagine if prefab amount is around 4 thousand, considering all little props, items, mobs etc. Artist will drive nuts working like that. So, custom editors is the only option, you could sort specific item lists under different categories, also show how they look or will look. That would be much more easier to work with and focus on map building than trying to find specific item for 10 minutes. It means, each item, Quest, NPC, monster, gun, attachment, etc should be somehow recognizable (specific number or something), but how? If in simple case all what it has is a tag ? Creating a structured list for each type of item would be best logic, for example one list for pistols, one for magazines etc. When the list is created you can easily access it from any point in your game And custom editors. Which means if you update you food list, your custom editor will automatically will be updated. So basically when having these lists, you can spawn anything and anywhere And track things via Log. So first, we create the list (array) which will hold information about the items. This script should be on player itself. public class Items : MonoBehaviour{ //We create a Node, possible information each this current item will hold [System.Serializable] //Without this next class "Item" wouldn't not show in inspector public class Item{ public string name; // its name public int weight; //just showing the idea } public Item[] allItems; //This is just for showing how it might work public InfoAboutItem(int index){ //This will be called from player Debug.Log("You picked up " + allItems[index].name + " and it weights " + allItems[index].weight); } } After attaching script you basically now can create item list in any size you want, and each can contain lots of information. Now we need a script which will be located on item itself, so we would know what item is that. public class ThisItem : MonoBehaviour{ public int itemIndex; // remember that first element is 0 not 1 } Yes, that's it . Now the script which will find the item. Also on player. public class Player : MonoBehaviour { void OnTriggerEnter ( Collider col ){ if (col.tag == "Item") { //All previous items in game can be under one tag "Item" GetComponent<Items>().InfoAboutItem( col.GetComponent<ThisItem>().itemIndex ); Destroy(col.gameObject); } } } Set the list in size of 1 (in inspector), in first element fields, enter its name and weight. Place ThisItem script on the pickable item, set index to 0, tag should be "Item" After triggering the item the text will appear and it will be destroyed. This is the basic idea how you can create very advanced item in game structures. Sorry if i didn't notice grammar errors, and i didn't test the code, as i am writing this from phone. If you have any problems or questions, ask.
  • Create New...