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

  • Last visited

  • Days Won

    64

Everything posted by geckoo

  1. What is your request? Maybe you posted this video in a wrong section. So it could be better in Showcase no?
  2. You are welcome. Happy ++
  3. You understand the main idea - you must define different destinations. I give you a function which you should integrate in your project to set for each enemy a randomize Vector3 around the wall. Then set for each enemy its destination : https://docs.unity3d.com/530/Documentation/ScriptReference/NavMeshAgent.SetDestination.html // the first Vector is the center of your wall (its position) - the second a radius according the size of your wall Vector3 RandomCircle(Vector3 center, float radius) { float ang = Random.value * 360; Vector3 pos; pos.x = center.x + radius * Mathf.Sin(ang * Mathf.Deg2Rad); pos.y = center.y + radius * Mathf.Cos(ang * Mathf.Deg2Rad); pos.z = center.z; // set here a height return pos; // return a Vector3 around the wall } // agent.SetDestination(RandomCircle(wall.transform.position, radius));
  4. The first post with link has been posted 4 years ago. I don't have this file. Maybe someone else ++
  5. I assume that simply you should modify physic material ++ https://docs.unity3d.com/Manual/class-PhysicsMaterial2D.html https://docs.unity3d.com/Manual/class-PhysicMaterial.html Simple grammar question : It is strange that one of them is defined as a singular word (Physic Material - for 3d) but the second as a plural (Physics Material - for 2d). Can you explain?
  6. Thank you for your comments which are all useful. @OcularCash - I did all my tests using CC (without RB) because I prefer it - as you said. I should try with the second. @reaperkan - thank for the link. I will take a look at it. maybe there is a way... @fennix - I have a doubt. I assume that a hook uses another metod. However, thank you ++
  7. Hello my fellows. I am struggling hard so as to create a custom character which allows to modify gravity. I did many test with the CC which is embedded in Unity, but without any good result. Also I tested a false gravity controller, rotating the whole world to simulate a gravity change. No good. There is a video on YouTube which explains as well what I am trying to do. If you have an idea about how I could get a same result, I will really appreciate all suggestion. Take a look at it. Thank you for your help. Have a nice day ++
  8. Do a SuperHot clone. It's maybe the easier way to do quickly something in les than 48 hours. does anyone knows how can i convert the "Time Travel 'Einstein'" to simple game? You made my day
  9. Hello fellows. I am searching somebody who could read (playing a role) and record a short text in english for my latest project - something dark, sad and weird. Maybe 20/25 words maximum. I would like to hear an adult voice - not too deep. Do you remember the voice of the hero in Bioshock Infinite? This is my will... Don't expect to get paid. I cannot. Sorry. So if you have a good recorder - and if you are interested, you can write me a PM. Thank you ++
  10. The eBook "Unity 5 shader coding" by Alan Zucconi is FREE - no credit card required. You must make an account. A good stuff... https://www.packtpub.com/packt/offers/free-learning Below the main page you can find a few eBooks - and available for free. There is something about Unity 5 for absolute beginners ++
  11. https://github.com/keijiro This is not really easy to impress me. There is so many developers - sometimes good, even sometimes very good. However, I really appreciate one guy almong them. This developer is just awesome - a genius. His work on shaders and effects under Unity is amazing - he breaks up the limits displaying some beautiful renders, developing unreal codes. His name - Keijiro Takahashi. He worked at Sony Computer Entertainment for ten years, and currently working for Unity Technologies. Often he shares on Tweeter his work, but you can find some free works on his GitHub repository. If you have time, take a look at his shaders. I like what he does - for me it's a real source of inspiration ++ Some examples : Special Effects with Skinned Mesh in Unity Forestica PostProcessing demo PS : do a search on Google using his name and take a look at the images - this is explicit ++
  12. Thank you OcularCash. I have never heard anything about OnWillRender()
  13. Hi Fellows! Sometimes we use always the same functions or commands in order to code an action or a behavior. These lines are often used in scripts, but it is possible to optimize code. I would like to share some tips here just to start a new section. If you have an useful idea (maybe just one line) and if you want to share it with us, give us a brief explanation and why this alternative is better than the previous. Don't forget that sometimes the simplest things are better than hardest. Best regards ++
  14. Hi OMA. Of course, I talk about my own experience. I did many tests using Vector3.Distance or its alternatives which we quoted. My project Debug.Mode uses many mechanics - and one of them allows to rescale some objects according player distance (2'02''). In another scene, with more than 2500 objects (a grid 50x50) I had some bad result using Vector3.Distance checking colliders. For me, magnitude value was very more smooth and efficient. I have no doubt about your skill, but I noticed something else. It could be interesting to check them ++
  15. There is a little bug on the FPSController which is embedded in Unity. When you jump (exactly when you are jumping) if you press again the space bar, so touching the ground, the player jumps again. This is not litterally a bunny jump, but obviously this behavior is not required. There is something wrong. In order to fix this bug, you must check another condition. Take a look at the script FirstPersonController - line 66. Add a parameter which checks events - so when the player is jumping, it doesn't allows any jump. See below : // change this line... if (!m_Jump) m_Jump = CrossPlatformInputManager.GetButtonDown("Jump"); // a second condition is required if (!m_Jump && !m_Jumping) m_Jump = CrossPlatformInputManager.GetButtonDown("Jump");
  16. One of the best way to play all sounds in a project. Create an empty object which uses DontDestroyOnLoad. Use the function below. Then find it as a reference using GameObject.Find() in your scripts which have sounds. One object, one AudioSource, one function... All sounds in my project Abaddon use this way. It allows easily to play variations with Random.Range ++ GameObject gm; // game manager void Start() { gm = GameObject.Find("GameManager"); // find script and play a sound gm.GetComponent<GameManager>().playSound(mySound, this.transform, false, Random.Range(0.3f, 0.5f), Random.Range(0.3f, 0.5f), mySound.length); } // manages multiple sounds on the same GO adding a new child public void playSound(AudioClip newSnd, Transform tf, bool prt, float v, float p, float t) { // sound features var soundObject = new GameObject("snd"); // creates a GO var tmpAudio = soundObject.AddComponent<AudioSource>(); tmpAudio.clip = newSnd; // argument which has been defined tmpAudio.volume = v; tmpAudio.pitch = p; if(prt == true) tmpAudio.transform.parent = tf; soundObject.transform.position = tf.position; // pos tmpAudio.Play(); // destroys this one after a while given - audioSound.length Destroy(soundObject, t/p); }
  17. Don't use Vector3.Distance to check distance between two objects. It could be more efficient to use an alternative. Here an explanation about this tip - http://answers.unity3d.com/questions/384932/best-way-to-find-distance.html // checks distance between two objects - Vector3.Distance(first.transform.position, second.transform.position). Vector3 offset = first.transform.position - second.transform.position; float dist = offset.magnitude;
  18. It seems that the picture is not longer available, but the link to the file works. Tested ++
  19. Welcome. You are experienced. I hope that you can improve the relevance of our forum ++
  20. Respectfully I would like to remind all of you that Jesus said "be cool with your neighbors" A funny sentence in order to convince you to get a good behavior here. Thank you ++
  21. A game for free - Dungeons 2 https://www.humblebundle.com/store/dungeons-2 Available until tomorrow ++
  22. A first question. Photon, uNet?
  23. Using animations? Legacy or mecanim? Nav mesh agent or simple translation? I assume that even if I give you an enemy script, you are not able to adapt it in your project. However take a look at this one. You can see it in my game Abaddon - the spider. https://geckoo1337.itch.io/abaddon It uses a nav mesh agent and legacy animations. Please don't say me that "it doesn't work!". You MUST change some parts according your own project ++ using UnityEngine; using System.Collections; // manages spider behavior and its features public class Spider : MonoBehaviour { GameObject ply; // player GameObject gm; // game manager Color col; // to manage hit effect float speed; float threshold; float spit; float attackAng; // spittle prefab public GameObject spittle; public GameObject splitSpawn; bool hurtMe = true; bool navMeshToggle = true; public int hp = 4; // health public int point = 50; // score public AudioClip boom; // sound when spider dies public AudioClip taunt; // sound when spider attacks public GameObject deathFX; // effect when spider dies public GameObject dust; // dust // manages nav mesh agent private UnityEngine.AI.NavMeshAgent agent; protected Animation anim; bool _spit = true; bool _anim = true; void Start() { ply = GameObject.FindWithTag("Player"); // target agent = gameObject.GetComponent<UnityEngine.AI.NavMeshAgent>(); agent.SetDestination(ply.transform.position); gm = GameObject.Find("GameManager"); // needed to play sounds col = this.transform.GetComponentInChildren<SkinnedMeshRenderer>().material.color; speed = Random.Range(3.5f, 3.8f); threshold = Random.Range(2.8f, 3.2f); spit = Random.Range(6.0f, 7.5f); attackAng = Random.Range(45.0f, 80.0f); agent.speed = speed; agent.stoppingDistance = threshold; anim = GetComponent<Animation>(); // at start if (!anim.isPlaying) anim.CrossFade("Idle"); } // some fire rate when the spider spits IEnumerator spitOnMe(float time) { _spit = false; yield return new WaitForSeconds(time); _spit = true; } // manages death animation IEnumerator deathAnim(float time) { /* anim.Stop("Run"); anim.Stop("Attack"); anim.Stop("Idle"); if (!anim.isPlaying) anim.CrossFadeQueued("Death", 0.1f, QueueMode.PlayNow); */ anim.Blend("Death"); // smooth animation // disables collider this.transform.GetComponent<BoxCollider>().enabled = false; // play a sound if (boom != null) gm.GetComponent<GameManager>().playSound(boom, this.transform, false, Random.Range(0.3f, 0.5f), Random.Range(0.3f, 0.5f), boom.length); // then displays dust as a health bonus yield return new WaitForSeconds(time); var fx1 = Instantiate(deathFX, this.transform.position, Quaternion.identity); var fx2 = Instantiate(dust, this.transform.position, Quaternion.identity); // destroy spider body and dust Destroy(fx1, 2.0f); Destroy(fx2, 4.0f); Destroy(gameObject); } void FixedUpdate() { // this condition manages eventually a dysfunction - the spider has fallen (not possible but why not) if (this.transform.position.y < -10) Destroy(gameObject); agent.SetDestination(ply.transform.position); OnOffNavMeshAgent(); // spider is dead if (hp <= 0 && _anim == true) { gm.GetComponent<GameManager>().addScore(point); // increases score agent.Stop(); _anim = false; StartCoroutine(deathAnim(1.75f)); } // checks distance between spider and its target Vector3 offset = ply.transform.position - this.transform.position; float dist = offset.magnitude; if (dist <= spit && _spit == true) { // create spittle and apply force on rigidbody var bullet = (GameObject)Instantiate(spittle, splitSpawn.transform.position, splitSpawn.transform.rotation); bullet.GetComponent<Rigidbody>().velocity = bullet.transform.forward * 10; // set time until another spit StartCoroutine(spitOnMe(Random.Range(5.0f, 8.0f))); } // spider attacks now if (dist < threshold && hp > 0) { navMeshToggle = false; if (hurtMe == false) return; // checks dodge or applies damage StartCoroutine(damageMe(Random.Range(14, 16))); // play a sound when spider attacks if (taunt != null) gm.GetComponent<GameManager>().playSound(taunt, this.transform, false, Random.Range(0.6f, 0.9f), Random.Range(0.6f, 0.9f), taunt.length); } else if (hp > 0) navMeshToggle = true; } // manages animations according state void OnOffNavMeshAgent() { Vector3 toTarget = (ply.transform.position - this.transform.position).normalized; if (navMeshToggle == true && hp > 0) { agent.Resume(); if (!anim.isPlaying) anim.CrossFadeQueued("Run", 0.1f, QueueMode.PlayNow); } else if (navMeshToggle == false && hp > 0 && Vector3.Dot(toTarget, transform.forward) >= -0.5f) { agent.Stop(); if (!anim.isPlaying) anim.CrossFadeQueued("Attack", 0.1f, QueueMode.PlayNow); } else if (navMeshToggle == false && hp > 0 && Vector3.Dot(toTarget, transform.forward) < -0.5f) { agent.Stop(); if (!anim.isPlaying) anim.CrossFadeQueued("Idle", 0.1f, QueueMode.PlayNow); } } // this function checks if spider has hit the player behind him bool isBehind(GameObject ply) { var sum = Mathf.DeltaAngle(ply.transform.rotation.eulerAngles.y, this.transform.rotation.eulerAngles.y); if (sum > -60.0f && sum < 60.0f) return true; else return false; } // checks a new player position in order to know if he can avoid the spider attack bool dodge(GameObject ply) { float heightOfPlayer = 0.8f; Vector3 startVec = transform.position; startVec.y += heightOfPlayer; Vector3 startVecFwd = transform.forward; startVecFwd.y += heightOfPlayer; Vector3 rayDirection = ply.transform.position - startVec; if ((Vector3.Angle(rayDirection, startVecFwd)) < attackAng && (Vector3.Distance(startVec, ply.transform.position) <= threshold)) return true; else return false; } // manages attack IEnumerator damageMe(int dmg) { hurtMe = false; // time for next attack yield return new WaitForSeconds(1.0f); // the spider hits the player behind him - damage * 2 if (isBehind(ply) == true) dmg *= 2; // applies damage or increases score if (navMeshToggle == false && dodge(ply) == true) gm.GetComponent<GameManager>().health(dmg); else // dodge! - get points gm.GetComponent<GameManager>().addScore(10); yield return new WaitForSeconds(0.5f); hurtMe = true; navMeshToggle = true; } // manages effect when the spider has been hit by a bullet IEnumerator hitFX() { this.transform.GetComponentInChildren<SkinnedMeshRenderer>().material.color = Color.red; yield return new WaitForSeconds(0.15f); this.transform.GetComponentInChildren<SkinnedMeshRenderer>().material.color = col; } // decreases spider health public void hit() { hp--; StartCoroutine(hitFX()); } }
  24. https://geckoo1337.itch.io/abaddon Abaddon is the hebrew name for the angel of the abyss in the Bible (apocalypse 9:11). Today this is just my entry for the 38th LudumDare session. I did a paced FPS - a survival game in which you must fight against a horde of mischievous creatures in a little arena (50x50). The columns delimitate your small world (the theme). When you see them, it means that you are not far to the void. Be careful! Each creature has its own behavior : a skull follows you in a wave movement and explodes near of you. A ram twirls around you, trying to hit you. A spider is looking for fresh meat and it spits on you its poison. The monster comes from the ground and knocks you really hard... Excepted the last specie, you cannot see how and where are spawned the enemies. I did many scripts to create an oppressive and darkly environement from which the creatures appear. You are always surounded by them. Kill them and try to do the best score which will be saved automatically in a leaderboard - the hall of fame. Using the LMB, you shoot fireballs, also using RMB, you shoot like with a shotgun, but its firerate is low. When you kill a monster or a spider, some blue dust appears. Passing through it, you gain health... I guess that if you can (more or less) define how the spawn script works, you can elaborate an efficient strategy. Please play this game and tell me your point of view. I hope that you enjoy. Thank you. I wish you the best. Bye ++
  25. I see a parrot. Really I cannot say where is the weapon