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.

UnityGamesRoland

Donator
  • Content Count

    862
  • Joined

  • Last visited

  • Days Won

    98

Everything posted by UnityGamesRoland

  1. UnityGamesRoland

    TDS Control - Top Down Shooter Kit

    Looks pretty cool. I really like the UI as well. My main issue when I started working on top-down shooters was the animation solving. So if anyone is having the same issue, here you go: Of course this system only works if you have a 2D blend tree set up for the movement animations. You also have to have 2 float parameters named "Horizontal" and "Vertical" for the blend tree. //Animate the character's movement to match the given direction. public static void AnimateCharacterMovement(Animator animator, Vector2 direction) { Vector3 moveDirection = Vector3.forward * direction.y + Vector3.right * direction.x; Vector3 animDirection = animator.transform.InverseTransformDirection(moveDirection.normalized); animator.SetFloat("Horizontal", animDirection.x, 0.06f, Time.deltaTime); animator.SetFloat("Vertical", animDirection.z, 0.06f, Time.deltaTime); } //These should obviously be cached in some way (animator in start or awake, inputDirection is in update). Animator animator = GetComponent<Animator>(); Vector2 inputDirection = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")).normalized; //Calling the static function. YourClassName.AnimateCharacterMovement(animator, inputDirection);
  2. UnityGamesRoland

    GamesWatch - Great site for game references

    Game references for fans and game creators alike. https://gameswat.ch/
  3. UnityGamesRoland

    Blender to Unity missing Edge?

    Can you show us the wireframe of the models?
  4. UnityGamesRoland

    Kingdom Studios (Profit Share)

    Now this is how you can get people to help you. These mock-ups are really good for a general understanding of the project(s) and it also shows that you will be useful for the team as well. Unfortunately I don't have time for smaller projects, but I'm certain that you will find people who are happy to help realizing these games. Make a post on the unity forums if you haven't already (and make sure to include the mock-ups). Best of luck! ๐Ÿ˜‰
  5. For my manager scripts (such as MenuManager, GameManager, etc...) I always use the singleton pattern. Recently I looked into generics and came up with this code: using UnityEngine; using System.Linq; public abstract class SingletonBehaviour<T> : MonoBehaviour where T : MonoBehaviour { public static T Instance { get; private set; } private void Awake() { //Creates a singleton for the class that derived this class. CreateSingleton(); } protected void CreateSingleton() { //If an instance is already assigned, destroy the current class. if (Instance != null) DestroyImmediate(this); //The class doesn't have an instance yet, so we can safely assign the first available. else Instance = Resources.FindObjectsOfTypeAll<T>().FirstOrDefault(); } } As you can see, the CreateSingleton() method is called in Awake(). I've done some tests and it turns out that I can access the Instance in an Awake() without any errors. Like this: //This class derives SingletonBehaviour, which sets up the Instance variable of this class in Awake(). public class InputManager : SingletonBehaviour<InputManager> { public string debugString = "It works! Wohoo!"; } //Test class which accesses the Instance of the InputManager, also in Awake(). public class Test : MonoBehaviour { private void Awake() { Debug.Log(InputManager.Instance.debugString); } } Is there a chance that the Test script would try to access InputManager.Instance before it is assigned? I'm suprised that there were no errors, I always used Awake() for assigning and Start() for accessing members.
  6. UnityGamesRoland

    Increase quality distance

    Change Anisotropic Textures and Texture Quality (both inside Quality Settings window) for better results.
  7. UnityGamesRoland

    Is it possible that this code would break sometimes?

    @OcularCash I've tried moving things around but it still worked. ๐Ÿ˜„ Anyways I'll stick to using Awake() and Start() as I said before just to make sure. Are there any benefits of caching the singleton instance of a class though? Would this make a difference in performance? //This would be assigned in Start() but I'm lazy to type that much lol public InputManager input = InputManager.Instance; void Update() { //InputManager's instance is not cached. Debug.Log(InputManager.Instance.debugString); //Using the cached InputManager singleton instance. Debug.Log(input.debugString); }
  8. UnityGamesRoland

    Multiplayer Player Sounds

    Make sure that the audio source's (that is playing the sound) Spatial Blend is 3D and not 2D.
  9. UnityGamesRoland

    Can't play walk anim while moving left & right.

    Replace: if (Input.GetAxis("Vertical") > 0.2f && Playercontroller.isGrounded) { ... } With: if (Playercontroller.velocity.magnitude > 0.2f && Playercontroller.isGrounded) { ... }
  10. UnityGamesRoland

    Access class Array veriables

    //Prints the array's first element's myString variable. Debug.Log(array[0].myString); //In most cases you will use arrays/lists with a loop for(int i = 0; i < array.Length; i++) { //Prints the array's i-th element's myString variable. Debug.Log(array[i].myString); }
  11. Im working on this pack a few days now, and im proud of my work. It is completely made from scratch by me. It contains a complete modular, advanced raycast based shooting script. You can create any type of gun within seconds. You can use it in your project, no credits required. Download the pack here! The pack has two scripts. Both script has a user friendly interface: Features: Ammo (Counts in bullets) Ammo Pickup Shoot Mode (Auto and Semi) (You can also switch between the two) Particles and Sounds Spread GUI Display (Weapon name, current ammo / inventory ammo, shoot mode) Setup: Find your gun and assign the RaycastShoot script into it. (You can easily do that via the custom menu: Add Component > AdvancedShoot > RaycastShoot) Create a new tag ("ammoPickup") and add this tag to the object you want to use as ammo pickup. Add the ammoPickup script to the player, and assign your current weapon to the affectedWeapon slot. (This will be the gun that you get ammo for.) Play with the values of the scripts, and enjoy your advanced shooting mechanics. There are two examples for hit effects: "Ground" and "Enemy" (Create new tags for these, and add them to your objects.) You can extend these in the RaycastShoot script at the 128. line, but dont forget to also do that at the 165. line. Donate: If you found this pack useful, you can donate me by clicking here! Some of you know me, and know that im not doing this for the money, but these days money is necessary.
  12. I've been working on this souls like game in the past few weeks. Looking for feedback! ๐Ÿ˜ As you can see in the title, this is a project that I'll be able to showcase if I apply for a job. Features: Responsive code driven movement (walking, running, crouching, falling) with animations for each state. Combat system, with chainable attacks, blocking, dodging, and a custom hitreg system. AI, that can move around player or retreat, can attack, and break defense of player. Gameplay HUD with health, stamina, and rune indicators. Entity (Player/AI) health & stamina + customizable stats for regen rates, damages, attacks, etc... Everything is made from scratch! (Except the animations and the character of course.) Latest showcase video: 2018-11-02_14-00-52.mp4
  13. UnityGamesRoland

    My Souls Like "Portfolio" Project - Progress Report

    I might do some pickups later on (like herbs or something), thanks for the feedback! Here are the textures that I use for testing.
  14. UnityGamesRoland

    object dosen't hide/despawn

    gameObject.transform.parent.FindChild("Cancas").FindChild("txtSkydive").gameObject.SetActive(false); Is it really supposed to be "Cancas"? I swear to god, if the console shows any errors and the script doesn't compile properly because of that spelling mistake, I'm gonna ignore your posts from now on...
  15. UnityGamesRoland

    I am from India..and love to develop games.

    I don't even know how can anyone end up on serveral year old posts. ๐Ÿคจ
  16. GPU instancing is what you are looking for. Also you can consider using Impostors.
  17. UnityGamesRoland

    Bullet Tracer Problem

    I think you overcomplicated this in your head. Just a few things that doesn't make sense to me: Why do you rotate the tracer spawn point? What's the point of converting the direction from local to world space? (TransformDirection) The tracer spawn point is attached to the gun or whatever it is right? Then all you have to do is spawn the tracer at the position of the spawner with the same rotation as the spawner. Then apply forward force on the tracer. This will spawn a tracer and launch it in the spawn point's forward direction (the blue arrow of the transform): private IEnumerator Fire() { //Instantiate a tracer at tracerSpawnPoint with the same rotation as tracerSpawnPoint. Rigidbody instantiatedTracer = Instantiate(tracerRound, tracerSpawnPoint.position, tracerSpawnPoint.rotation); //Since the tracer is rotated, just apply forward force on it. instantiatedTracer.velocity = instantiatedTracer.transform.forward * tracerSpeed; }
  18. UnityGamesRoland

    warning CS0649

    It means that there is a variable called "skydiving", it is a bool (true/false statement -- according to its name, it probably tells the system: "am I close enough to the ground to open parachute?"). It has logic connected to it, but its value is never changed therefore the logic connected to it always does the same thing.
  19. UnityGamesRoland

    same error.. 0246

    Put this on the top of the PlaneCameraController script. using Player;
  20. UnityGamesRoland

    Simple trigger script

    How did it work for you if you have "Is Trigger" disabled? ๐Ÿ˜… Anyways, I've extended it to work with layers. This way you only need one enter/exit event. using UnityEngine; using UnityEngine.Events; public class Trigger : MonoBehaviour { public LayerMask layer; public UnityEvent OnEnter; public UnityEvent OnExit; public void OnTriggerEnter(Collider other) { if (layer == (layer | (1 << other.gameObject.layer))) OnEnter.Invoke(); } public void OnTriggerExit(Collider other) { if (layer == (layer | (1 << other.gameObject.layer))) OnExit.Invoke(); } }
  21. UnityGamesRoland

    Bullet Tracer Problem

    Why not just do this? instantiatedTracer.velocity = instantiatedTracer.transform.forward * tracerSpeed;
  22. UnityGamesRoland

    Materialize - Image to Material Tool

    Materialize is a stand alone tool for creating materials for use in games from images. You can create an entire material from a single image or import the textures you have and generate the textures you need. I've done a bit of testing, the generated textures (from the diffuse) were nice, and I love that you can actually see how the material will look in unity. The user interface is bad, but hey it's free. Check it out: http://www.boundingboxsoftware.com/materialize/
  23. UnityGamesRoland

    error CS0246

    Make sure that in the Look script the class is called Look as well. //Calling the script "Look" in unity is not enough on its own. //The class name inside the "Look" script has to be "Look" as well. //Look.cs public class Look : MonoBehaviour { //... }
  24. UnityGamesRoland

    White line of death [Unity3D]

    Isn't it a gizmo? I've just noticed you have gizmos enabled on the game view.
  25. UnityGamesRoland

    Details/grass didn't rendered in terrain

    Did you just remove the rendering pipeline from your project? I don't think thats a good idea lol. Unity just announced that in 2018.3b they have the core of the new terrain system btw, you might want to check it out.
ร—