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.

geckoo

Moderators
  • Content Count

    2,816
  • Joined

  • Last visited

  • Days Won

    155

Everything posted by geckoo

  1. Personal preference. For one line it's just useless... I guess that a debate about it could be even more useless
  2. When I read your answer, I said to myself you are trolling us Many of these brackets could be ignored in this script. I have never understand why some want to put brackets when there is only one command line after a condition. Also I noticed that you forgot to add index in your loop. How could you disable some components? Take a look at this script which works as expected ++ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; namespace Networking { public class ComponentsToDisable : NetworkBehaviour { public List<Behaviour> Components = new List<Behaviour>(); private void Start() { if (!isLocalPlayer) for (int i = 0; i < Components.Count; i++) Components[i].enabled = false; // index else Camera.main.gameObject.SetActive(false); } } }
  3. Unusual - really nice. I would like to see more elements and something more realistic as a table or a board because I have no clue what it is ++
  4. geckoo

    Selective Bump

    Answering to a question, I share with you a simple material shader which allows to select zone applying a Bump FX ++ No bumped no masked (original texture) Bumped but no masked Bumped and masked with a simple frame Shader "Custom/SelectiveBump" { Properties { _MainTex("Albedo (RGB)", 2D) = "white" {} _MaskTex("Mask", 2D) = "white" {} _BumpMap("Bump Map", 2D) = "bump" {} } SubShader { Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True" } LOD 200 Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM #pragma surface surf Standard #pragma target 3.0 sampler2D _MainTex; sampler2D _MaskTex; sampler2D _BumpMap; struct Input { float2 uv_MainTex; float2 uv_MaskTex; float2 uv_BumpMap; }; void surf(Input IN, inout SurfaceOutputStandard o) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex); fixed4 m = tex2D(_MaskTex, IN.uv_MaskTex); o.Albedo = c.rgb; o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap) * m.a); // apply mask } ENDCG } FallBack "Diffuse" }
  5. Well. I took a look at this shader because a parameter seamt to me wrong - mask doesn't work. I guess that the developer has tried to apply a selective bump FX according a mask texture. I fixed this mistake - and now it works great. Bump FX is shaded. Try it ++ No bumped no masked (original texture) Bumped but no masked Bumped and masked with a simple frame Shader "Custom/SelectiveBump" { Properties { _MainTex("Albedo (RGB)", 2D) = "white" {} _MaskTex("Mask", 2D) = "white" {} _BumpMap("Bump Map", 2D) = "bump" {} } SubShader { Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True" } LOD 200 Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM #pragma surface surf Standard #pragma target 3.0 sampler2D _MainTex; sampler2D _MaskTex; sampler2D _BumpMap; struct Input { float2 uv_MainTex; float2 uv_MaskTex; float2 uv_BumpMap; }; void surf(Input IN, inout SurfaceOutputStandard o) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex); // main texture fixed4 m = tex2D(_MaskTex, IN.uv_MaskTex); // mask texture (use normal) o.Albedo = c.rgb; o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap) * m.a); // mix bump and mask textures } ENDCG } FallBack "Diffuse" }
  6. I assume that it's just a material shader - I guess a simple bumped diffuse with a mask. I noticed some bad characters in this script which I erased. Replace previous by this one. It works for me ++ Shader "Custom/Shader" { Properties{ [Enum(UnityEngine.Rendering.CullMode)] _Culling("Cull Mode", Int) = 2 [NoScaleOffset] _MainTex("Albedo (RGB)", 2D) = "white" [NoScaleOffset] _MaskTex("Mask", 2D) = "white" [NoScaleOffset] _BumpMap("Bump Map", 2D) = "bump" } SubShader{ Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" "IgnoreProjector" = "True" } LOD 200 Cull[_Culling] Blend SrcAlpha OneMinusSrcAlpha CGPROGRAM #pragma surface surf Standard #pragma target 3.0 sampler2D _MainTex; sampler2D _MaskTex; sampler2D _BumpMap; struct Input { float2 uv_MainTex; float2 uv_MaskTex; float2 uv_BumpMap; }; void surf(Input IN, inout SurfaceOutputStandard o) { fixed4 c = tex2D(_MainTex, IN.uv_MainTex); fixed4 m = tex2D(_MainTex, IN.uv_MainTex); // wtf? o.Albedo = c.rgb; o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); o.Alpha = m.rgb; } ENDCG } FallBack "Diffuse" }
  7. geckoo

    Debug.Mode

    Hello. I need someone to test my latest project - an intuitive minimalist puzzle game which is named Debug.Mode (for windows). It is ready for release... I would like to read a brief feedback about mechanic, main gameplay, mood, etc. If you have just one hours (or less), let me know please - send me a PM. Thank you for your support ++ https://imgur.com/a/R67TyWP
  8. Really I would like to hear more tracks from you - show us your new work soon ++ Good luck in your quest to the almighty sound
  9. Hello Zac. Well done and pleasant. However I am not an unconditional fan of this music, even through I like all creative activities. For this reason I took a look at your work and I listened. Well It is a little bit repetitive no? It seems to me that it is always the same track, but it's good enough. I would like to hear more varations - maybe a melodic sequence. I assume that I don't understand the main feelings because I am from an another generation - when playing a real instrument meant something. Don't be offended by my explaination. In fact, I liked this beat - not a music, just some good vibes to have a bit of fun no? The more important can be summarized this way : if you like it, do it - no matter they say (even me) ++
  10. geckoo

    Prototype

    I did a big update yesterday adding a dynamic sky with cloud, another amazing edge detection FX which is really impressive and a vignetting more efficient. On the main project page, there is a picture which shows the main renderer using those three FX in the same time - and they work as expected through the portals too (legacy FX don't do that). And a big big big clean up on the main project ++ https://geckoo1337.itch.io/project-a
  11. As said OcularCash, I used too this way to save modifications on objects - copy component/paste values However you presented us a good stuff. Thank you ++
  12. geckoo

    Prototype

    I posted today a simple prototype in which you can play with some interesting mechanics - portals, custom gravity (controller/objects), etc. This is not a game, but instead a sandbox for a future project (maybe a FPS style DeadCore). Now I have no clue what I could do with it (or more exactly what I want to do), but I am very happy because I fixed many bugs using Unity 2018.2 version. I improved code but I have a big amount of work so as to reach my goal. Take a look at this first release which is available on Itch.io and leave a comment if you want to help me developing this new project ++ https://geckoo1337.itch.io/project-a
  13. geckoo

    sort an array

    It could be interesting to do a test Writing my explanation, it were no really clear. I did some minor changes explaining code ++
  14. geckoo

    sort an array

    Recently, playing with enemies in my latest LD entry, I noticed that when I use an array in runtime, there is no order. As an example, using FindGameObjectsWithTag, obviously there is no logic, sorting all corresponding objects. However often we have to avoid some conflict between those objects. Another difficult issue is the fact that the player moves and its enemies too (the first now maybe will be the last soon). In my latest projects, the nearest enemy had to approach the player, then the second, the third, etc - and finaly the farthest. This way no one comes across its previous comrade in the line. So I find a way to sort an array, using a list and according a simple or complex function. In this code, I show you the method, but of course, you can improve it regarding your goal. A good stuff - a little tip ++ using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; // necessary to use a list public class SortArray : MonoBehaviour { public GameObject[] objs; List<GameObject> oo = new List<GameObject>(); float timer = 1.0f; IEnumerator Start() { objs = GameObject.FindGameObjectsWithTag("objTag"); // our array yield return new WaitForSeconds(1.0f); sortArray(); // sort an array using a list yield return new WaitForSeconds(1.0f); for (int i = 0; i < objs.Length; i++) if (objs[i] != null) Destroy(objs[i], timer * i); // for this example, I destroy them } float checkDistance(Transform x) { // simple function checking distance return Vector3.Distance(this.transform.position, x.transform.position); } // array to list - sort objects - list to array void sortArray () { // convert objects in a list by distance oo = objs.ToList(); // array to list oo = oo.OrderBy(x => checkDistance(x.transform)).ToList(); // sort them (nearest to farthest) objs = oo.ToArray(); // list to array } }
  15. Installing the latest Unity version 2018.2.7 which has been released a few days ago, all works fine excepted one shader. I don't know what it means but I am very happy ++
  16. geckoo

    WebGL bug

    Data is saved (levels progression), but when I start a new game (new page) sometimes, saved data doesn't appear. I have to refresh this page to see level progression ++
  17. Use a public function and simply call it when you hit an enemy. You have something like that : using UnityEngine; public class yourGun : MonoBehaviour { float bulletDistance = 100; // distance which bullet does RaycastHit hit; void FixedUpdate() { Vector3 fwd = transform.TransformDirection(Vector3.forward); // you hit something beyond you if (Physics.Raycast(transform.position, fwd, out hit, bulletDistance)) if (hit.collider.gameObject.CompareTag("Zombie")) // check tag on this object - is it a zombie? hit.collider.gameObject.GetComponent<zombieController>().applyDamage(); // it has a zombie script } }
  18. geckoo

    WebGL bug

    Hello everyone! I have a problem with a project which I am trying to export as a WebGL game. I am very surprised, but all works fine as expected. There is only one bug with playerprefs. As a standalone game, when you solve a level, you can reach the next - and it is saved. This way you can save your progression. However, as a WebGL project, when I launch my game, at start, I see nothing - no level has been saved. If I refresh the page (using Firefox Mozilla) I can see progression. What is the problem? Any idea? Thank you for your help ++
  19. I know that is an old post, but now I am too searching some information about procedural animation for biped. I understand the main principe taking a look at the Keijiro's work, but I am wondering how to compute steps - the place where the foot must hit the ground - and hinge joint does the work. Do you thing that I could just use a raycast to check what is below the foot or maybe there is another way which could be more efficient? If you had found something interesting about procedural animation, I will really appreciate any help. I spent many time, but I did not find any article or code really relevant and my attempts are not good - too basical. Thank you ++
  20. Привет друг мой. Тебе желаю успехов Always cool to meet other people here. I hope that you can increase your skill enjoying our forum. You said that you have some experience on Unity. Please show us something which you did recently ++
  21. Not bad. I thought that you could improve it, but not bad . I was just cynical ++
  22. geckoo

    Unity Bundle

    Exactly. 2 games + 3 epic assets for 1 buck minimum ++
  23. geckoo

    Unity Bundle

    Just a few words to say that there is a bundle in which you can find some intersting games which have been developed using Unity as engine like Oxenfree. Furthermore, you can buy for 1 buck minimum some assets which are available on Unity Store including UFPS, FlowCanvas and Inventory Pro. Their global price approaches 200$. In regard of their price, it's just a gift a few months before Xmas. For less than 10 dollars, you get Realistic Effects pack 4, Wasteland 2 and Gameflow. For 15$ you get Gaia and some good stuff... Take a look at the link below ++ https://www.humblebundle.com/games/unity-bundle
  24. geckoo

    mechanim

    Running mode could be implemented just using a float which is increased when you keep a shift key down - decreased when you release your key. There is an interesting video about it at this address with explanation ++
  25. geckoo

    Horizontal Compass

    Io sono molto contente que ti piaccia ciò che ho fato. Grazie per i complimenti
×
×
  • Create New...