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,818
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by geckoo

  1. LiwaHadri - my dear friend. Respectfully all your questions or requests show us an evidence - you are an absolute beginner. there is no shame in that - we were beginners too a few years ago. Please don't be offended by my advice. Don't use this kit or even any script which are available here or on the web before you have learned the basics. Today you are not able to do difference between a C# script and a JS - it's laughable. Really you have to learn some good tutorials - and all you need is below ++ https://unity3d.com/fr/learn/tutorials Mes amis tunisiens parlent couramment français et j'espère que c'est ton cas. Franchement, c'est ennuyeux. Tu poses des questions qui reposent sur un seul fait - tu es un débutant, lequel ne sait rien. Ce n'est pas grave - nous l'étions aussi. Commence par apprendre en utilisant des tutoriels adaptés à ton niveau. Tout ce dont tu as besoin est dans le lien ci-dessus. Bien sûr, tu peux nous interroger si tu ne comprends pas quelque chose, mais pose de vrai questions. Je te souhaite le meilleur - bon courage ++
  2. Thank you OcularCash for your answer. It helped me to find the solution I can set each point using a radius this way : for (int i = 0; i < numberOfPoints; i++) { float angle = i * Mathf.PI * 2 / numberOfPoints; Vector3 pos[i] = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0) * radius; } More easy - more efficient. It works perfectly. Thank you ++
  3. Working on a simple shader so as to apply a picture on screen, I found a way to create a broken glass shader like in Metro 2033. Also you can use this shader to create a frozen effect. I guess that it could be interesting for FPS project as damage FX or something else... As usual I use a sub folder callad MyShaders where my shaders are. Take a look at the link where I posted a picture ++ https://imgur.com/a/m2TC8ex PS : I use this texture in my project ++ https://yandex.com/collections/card/5aaa1d47be1d770087ac9f00/ using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(Camera))] public class BrokenScreenFX : MonoBehaviour { public Texture2D texture; [Range(0, 1.0f)] public float Amplitude = 0.5f; [Range(0, 1.0f)] public float Bias = 0.5f; Camera cam; private Shader BrokenScreenShader = null; private Material BrokenScreenMaterial = null; bool isSupported = true; void Start() { CheckResources(); if (texture == null) texture = Resources.Load("BrokenScreen") as Texture2D; } public bool CheckResources() { BrokenScreenShader = Shader.Find("MyShaders/BrokenScreen"); BrokenScreenMaterial = CheckShader(BrokenScreenShader, BrokenScreenMaterial); return isSupported; } protected Material CheckShader(Shader s, Material m) { if (s == null) { Debug.Log("Missing shader on " + ToString()); this.enabled = false; return null; } if (s.isSupported == false) { Debug.Log("The shader " + s.ToString() + " is not supported on this platform"); this.enabled = false; return null; } cam = GetComponent<Camera>(); cam.renderingPath = RenderingPath.UsePlayerSettings; m = new Material(s); m.hideFlags = HideFlags.DontSave; if (s.isSupported && m && m.shader == s) return m; return m; } void OnDestroy() { #if UNITY_EDITOR DestroyImmediate(BrokenScreenMaterial); #else Destroy(BrokenScreenMaterial); #endif } void OnRenderImage(RenderTexture source, RenderTexture destination) { if (CheckResources() == false) { Graphics.Blit(source, destination); return; } BrokenScreenMaterial.SetFloat("_amplitude", Amplitude/100); BrokenScreenMaterial.SetFloat("_bias", Bias * 100); BrokenScreenMaterial.SetTexture("_MainTex2", texture); Graphics.Blit(source, destination, BrokenScreenMaterial); } } Shader "MyShaders/BrokenScreen" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _MainTex2 ("Base (RGB)", 2D) = "white" {} } SubShader { Pass { Cull Off ZWrite Off ZTest Always CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma fragmentoption ARB_precision_hint_fastest #pragma target 3.0 #include "UnityCG.cginc" uniform sampler2D _MainTex; uniform sampler2D _MainTex2; uniform float _amplitude; uniform float _bias; uniform float4 _ScreenResolution; uniform float2 _MainTex_TexelSize; struct appdata_t { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; }; struct v2f { float2 texcoord : TEXCOORD0; float4 vertex : SV_POSITION; float4 color : COLOR; }; v2f vert(appdata_t IN) { v2f OUT; OUT.vertex = UnityObjectToClipPos(IN.vertex); OUT.texcoord = IN.texcoord; OUT.color = IN.color; return OUT; } half4 _MainTex_ST; float4 frag(v2f i) : COLOR { float2 uvst = UnityStereoScreenSpaceUVAdjust(i.texcoord, _MainTex_ST); float2 uv = uvst.xy; float2 brokenUV = uv; float3 fracture = (tex2D(_MainTex2, uv).rgb * _amplitude); fracture += (tex2D(_MainTex2, uv).rgb * _bias); brokenUV += float2(fracture.r, fracture.r)/512; float3 sum = tex2D(_MainTex, brokenUV).rgb; sum = sum + (fracture * _amplitude); return float4(sum, 1.0); } ENDCG } } }
  4. Hello. I am working on a script so as to create dynamically regular 2d shapes, only setting a circle radius in which shape is drawn. For shapes which use an even number of sides it's easy - I post below an example about how to create a regular hexagon (it's more or less the same principe for square and octogon because h² = AB² - (AB/2)² ). However I have no clue how I could compute these coordinates in the circle for shapes which are buildt with an odd number of sides like a pentagon or a heptagon. I am not really good with trigonometry. Have you an idea? Thank you ++ verticesHexagon = new Vector2[] { new Vector2(0f, radius), new Vector2(radius - (Mathf.Sqrt(radius) - Mathf.Sqrt(radius/2)), radius/2f), new Vector2(radius - (Mathf.Sqrt(radius) - Mathf.Sqrt(radius/2)), -radius/2f), new Vector2(0f, -radius), new Vector2(-radius + (Mathf.Sqrt(radius) - Mathf.Sqrt(radius/2)), -radius/2f), new Vector2(-radius + (Mathf.Sqrt(radius) - Mathf.Sqrt(radius/2)), radius/2f) };
  5. geckoo

    Ball movement script

    More seriously, you could just explain what you are trying to do, posting a first attempt which we can fix if it doesn't work, etc. You throw a little sentence, waiting something from us - please be explicit, respecting members and I guess that someone could help you... Respectfully don't be lazy ++
  6. geckoo

    Ball movement script

    Hello, I hope that you will find it
  7. maybe at first you could just learn on Unity tutorial how to use it
  8. Maybe because this project had been shared almost 3 years ago - and now it is no more available ? Try on GitHub ++
  9. A little function which is really useful - just to check in a string some forbidden characters and its lenght ++ string checkName(string nn) // nickname { int max = 15; // max chars as nickname nn = Regex.Replace(nn, "[^\\w\\._]", ""); // erase forbidden special chars return (nn.Length < max) ? nn : nn.Substring(0, max); // use only the first ones - 15 chars }
  10. Mathf.Lerp linearly interpolates between a and b by time - and our object goes slowly at the end. To get the same speed between a and b, we can increase it using percentage accomplished (0 to 1) ++ https://docs.unity3d.com/ScriptReference/Mathf.Lerp.html float timeLerped = 0.0f; float timeToLerp = 15.0f; private void Update() { timeLerped += Time.deltaTime; this.transform.position = Vector3.Lerp(this.transform.position, new Vector3(0, 0, 0), timeLerped / timeToLerp); }
  11. Maybe you know that, but I only today understand that we can use rich text : Debug.Log("<color=red>Alert message</color>");
  12. One word - amazing. Thank you for sharing. I really appreciate ++
  13. Hello. It's a little bit strange. I guess that you don't understand what you are doing. I don't know what you are trying to do exactly, however if you want some instanciating shaders examples, I recommend you to take a look at this page - there is an interesting explanation about instanciating shaders. I wish you the best : https://catlikecoding.com/unity/tutorials/rendering/part-19/
  14. geckoo

    Night Crisis

    It reminds me BF4 Interesting. However I thing that FX on camera are a little bit too loud/weird ++
  15. https://www.epicgames.com/store/fr/product/what-remains-of-edith-finch/home 88% on Metacritic - Cool game with an amazing aesthetic and an unusual gameplay - for free on Epic platform. This game has been created by those who released a few years ago The Unfinished Swan - all is said ++
  16. geckoo

    Fan Movies

    https://fanmoviewatch.com Often I shared with you some short movies especially those which has been created so as to copy/paste a blockbuster or a great universe - or a movie or a game, etc. Maybe you know KungFu Fury or Galactic Battles 2018, etc. Today I found an interesting site with many Fan Movies - some are great and as usual some are bad. However it is worth - take a look at the link which I posted upper. I watched some of them and they are really well done. As a proof of my allegation I want to share with you one reference - Portal: No Escape ++
  17. Hi. I recommend you to use a list which you could easily convert to an array. A few months ago I had written an old post about a similar request - it seems to me that it is exactly what you are trying to do. Take a look at the function sortArray which call another one - checkDistance - so as to sort in a list all objects - nearest to farthest. Then the list is converted to an array. I see in your previous code that you know how to use a simple loop - so you can interact with the three first objects in your array. I hope that it could be useful to you ++ https://armedunity.com/topic/15494-sort-an-array/
  18. geckoo

    Super Meat Boy

    For free on Epic games - a new platform ++ https://www.epicgames.com/store/en-US/product/super-meat-boy/home
  19. It has been posted just 3 days ago. I found it on Twitter, but I guess that in a few weeks it could be famous as was KungFu Fury which is my favorite indie movie ++
  20. Cross-over with Halo, StarTrek, MassEffect and StarWars. Well done. Why not?
  21. Maybe you instantiate a first as non-local, and another as local?
  22. Cool. I guess that it could be more interesting to use an orthographic camera instead a perspective view. Gameplay is good enough as a casual game. Thank you for sharing ++
  23. geckoo

    43th LudumeDare

    @DeepWolf Really well done with an amazing mood. All movements are so smooth - you did a great work. Models are cuties. Maybe too hard for me, but overall a great entry ++
  24. geckoo

    43th LudumeDare

    Finally I did (another) puzzle game - Entities. It is available at this link below : https://geckoo1337.itch.io/effigies https://ldjam.com/events/ludum-dare/43/effigies @DeepWolf - show me yours ++
  25. geckoo

    43th LudumeDare

    "Sacrifices must be made" is the theme Maybe it's time to change my plan creating a FPS ++
×
×
  • Create New...