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.


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by giltine528

  1. if i were to swap GetMouseButton(0) with Input.GetKey(KeyCode.R) for example, it would be smooth, so its something with that part that is wrong, but why and how can if fix it
  2. So basically what i want is to use a mouse to rotate around object. For example you have a planet and every time you drag a mouse you move around it. Im not very familiar with updates too much, but if make my rotation function dependent of input, it gets soo laggy when i use it. But if i were to put it just in an update, its smooth, any help? public bool enableRotation; public bool RotateAroundObject; public float RotationSpeed; public Vector3 cameraOffset; public Transform orbitTarget; public float smoothFactor; Quaternion camTurnAngle; Vector3 newPos; void Start() { cameraOffset = transform.position - orbitTarget.position; } void Update() { if (RotateAroundObject) { camTurnAngle = Quaternion.AngleAxis(Input.GetAxis("Mouse X") * RotationSpeed, Vector3.up); cameraOffset = camTurnAngle * cameraOffset; } newPos = orbitTarget.position + cameraOffset; transform.position = Vector3.Lerp(transform.position, newPos, smoothFactor); if (enableRotation) { transform.LookAt(orbitTarget); if (Input.GetMouseButton(0)) { RotateAroundObject = true; } if (Input.GetMouseButtonUp(0)) { RotateAroundObject = false; } } }
  3. Alright, thank you for the tip about the glow. And yes i do! But i think ill change it soon. Here is the preview
  4. giltine528

    A dog?

    HAHAHA Whaaat, good find!
  5. So when enabling the "stats" thingy on your Game window, you can see Cpu: main variable that displays a number for example Cpu: main 5.0ms For optimization purposes, what is a recommended value when making an optimized game? And how can i decrease it?
  6. giltine528

    Array of arrays

    int[,] allSequences = new int[,]{{1, 2, 3, 4, 5},{6, 7, 8, 9, 10},{11, 12, 13, 14, 15}}; [2,2] will print 13
  7. giltine528

    Kinda lost

    Just don't plan too much with them and you will be fine with any, I suggest avoiding making an FPS, because its honestly too stale and boring
  8. Don't want to sound like a unity fanboy, but Unreal Engine is so bad when it comes to load times, i can find a wife and get two kids until my game loads if its on hdd. It also frustrating that its not very friendly when it comes to minimizing the application. Unity is not going anywhere, its a great platform for starters and indie companies and imo indie companies often produce better quality games than some triple A games.
  9. Thank you! Im not sure yet. Its very playble right now, but i would like to learn how to do multiplayer, since i think its where this game would shine the most. The problem is, i do not know networking, so it will take quite some time to learn ( I dont even know which networking solution to pick) Then we have things like campaign, which i have great plans for. Who knows really, but i think it will be in Q4 of this year.
  10. Hello there, its been a while since i've posted something in here, so i thought i could give it a try and making an actual devlog on my current project. Its a strategy, turn based tile game in which your main goal is to have the most tiles conquered at the end of the game. Its a pretty simple concepts, but its quite fun. There's some thought process involved when making every turn and calculate opponents predictions, so gameplay wise, its pretty cool so far. Feedback is highly appreciated Right now it has: Core mechanics, such as generating tiles in a balanced way, placing them, conquering enemy tiles etc... Pretty color lerps lol Flexible match system that allows to make various game modes and story based stuff Smart AI that uses reward system and calculate all the best solutions for an optimal move. Main menu Modifiers Here are some screenshots P.S I felt pretty anxious when uploading this to public, but after couple days i managed to do it
  11. Imagine having a card stack, it contains a lot of cards that each have a value cost from 4 to 36 How does one generate a hand of 5 cards from a deck that has a sum value of <=60? Do i start drawing a first card with a random value and then draw the other ones accordingly?
  12. So, what i want is for a transform to tilt a bit based whenever he is walking to left or right, but the problem is that, if i start tilting in negative direction (Which is to right side), my character doesnt quite rotate as it should, this is got to do something with eulerAngles probably, so my question is, how does one solve this? using System.Collections; using System.Collections.Generic; using UnityEngine; public class RotationOnDirection : MonoBehaviour { public float z; void Update () { if (z >= 1) z = 1; if(z <= -1) z = -1; if (Input.GetKey(KeyCode.A)) { z += Time.deltaTime; Vector3 euler = transform.localEulerAngles; euler.z = Mathf.Lerp(euler.z, z*15, 2.0f * Time.deltaTime); transform.localEulerAngles = euler; } if (Input.GetKey(KeyCode.D)) { z -= Time.deltaTime; Vector3 euler = transform.localEulerAngles; euler.z = Mathf.Lerp(euler.z, z*15, 2.0f * Time.deltaTime); transform.localEulerAngles = euler; } } }
  13. giltine528


    Looks nice, keep it up!
  14. Good job! Hope to see more projects from you in the future, give it your best! I was like you when I started, and its kinda nostalgic to look at stuff like this. :upvote:
  15. Was just interested if there was something handy that you wished that someone had told you when you started with Unity?
  16. Okey Ive solved it with your idea by using Enter and Stay, but your method only is viable on one enemy, because once your hit one enemy, it enables the bool "once" and it cant damage the other enemies until the attack animation ends. I dont know if my approach was great but what I did is every time you hit someone, you Add that enemy to the list, and when another OnTriggerEnter event during attack animation occurs, it checks if the enemy is already in the list, if not apply the damage if yes, dont.
  17. Hello fellow unity members, its been a while since ive worked on something and now i came back and wanted to create couple of things. One of them being the melee system that uses "hit on touch" method or how do you say it. So what I want, Is whenever player swing his sword(plays animation) and if it touches the enemy, it damages it! I used OnTriggerEnter method void OnTriggerEnter(Collider other) { if (other.tag == "Enemy" && isAttacking) { Shake(0.2f); other.gameObject.GetComponent<EnemyHealthManager>().HurtEnemy(damage); } } It works fine, but there couple of problems 1.(0:00) If the sword is inside an enemy and you press attack, the enemy wont receive damage, because enemy was already in the trigger and didnt enter it. 2.(0:46) If you swing your sword randomly during the animation, the damage is applied multiple times, since it enters the trigger multiple times. Any idea on how to fix it? Please its really important, because if i get this problem solved, I might have my motivation back up on making a real project for once. Thanks!
  18. So lets say I have #include <iostream> using namespace std; class A{ protected: int random_number=10; public: A(){} A(int a){ random_number= a; } }; class B: public A{ public: string Text(){ string temp; if(random_number>9) temp="Yes"; else temp="No"; return temp; } }; int main(){ A a(5); B b; cout<<b.Text(); return 0; } How can I give my base class(A) "a" variable "random_number" value (which is 5) to my b class so it can print out the correct value?
  19. So I got a bit confused with one of the math questions Ive got and idk how to approach it, Ill bring out my solution but Im guessing its wrong: Problem: Chemical liquid consists of 3 ingredients(a,b,c) which are defined as percentages, so for example a chemical liquid consists of materials a-50% b-20% c-30%. Find out the new chemical liquids percentage expression if we pour the x% amount of selected ingredient to the current liquid. So for example if we pour 30% of "a" material into a liquid that consists of materials a-50% b-20% c-30% how will percentages change on these 3 values? Im guessing you just go like: 50*1.3=65% 20*0.7=14% 30*0.7=21% ? Thank you.
  20. True, that worked heh, on the other note, is my method of dashing done correctly or there is a better way?
  21. Hi, I havent programmed in a while, but I just wanted to do something fun atm. So first of all I wanted to create a dashing script, where the player when looked at certain object or empty space would dash to the location. I think I got the, looking at the object dashing, part correctly. But how do I go with dashing when looking at nothing? Dashing also includes the y axis, so you can do it into the air like a ninja. Here is the script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class MovementController : MonoBehaviour { public float Range; public Transform empty; public Transform Player; Camera cam; bool lerp; Vector3 pos; void Start () { cam = Camera.main; } void Update () { if (lerp) Player.position = Vector3.Lerp(Player.position, pos, 10f * Time.deltaTime); if (Vector3.Distance(Player.position, pos) < 1f) lerp = false; if ((Input.GetKeyDown(KeyCode.E))) { Ray ray = cam.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0)); RaycastHit hit; if (Physics.Raycast(ray, out hit, Range)) { if (!lerp) { Transform obj = Instantiate(empty, hit.transform.position, transform.rotation); pos = obj.position; pos.x = hit.point.x; pos.y = hit.point.y; pos.z = hit.point.z; obj.position = pos; lerp = true; } } else { if (!lerp) { } } } } }
  22. Note: This is all based on my current experience as of writing this, if you have anything to add that will help this post improve, feel free to share. My previous guides: 1.In depth guide of understanding the usage of colors- https://armedunity.com/topic/14303-in-depth-guide-of-understanding-the-usage-of-colors/ First of all I would like to remind you that all of these software and methods are free, you don't need to pay anything to use them. And overall this topic only covers non-paid methods on making yourself some sfx and music for your project. To start things with. 1.Audacity: -Probably the majority people know this peace of software. It's free and is being used for recording, editing and exporting audio. In here you can tweak your audio to suit your needs (make it "loopable", have normalized levels etc.) You use it at the end of your process after using all of the other softwares that will be listed below. Get audacity: http://www.audacityteam.org/ 2.Otama: -Its a browser only program (it requires a flash to use), that is probably good being used only if you're in a rush mode to make some quick background music for your project. You just put nodes, change their direction and then you get different melodies. Get Otomata: http://earslap.com/page/otomata.html 3.Jukedeck: -It another brower only thingy, but comparing to Otama, this one is a masterpiece, you select what kind of music you need, tweak what style you want, how many beats per minute you desire. And then computer automatically generates it. Its pretty neat. If you want to use your generated music for free, you can just give them credits, however only for 1$, you can buy the license of it and use it however you want. Use jukedeck: https://www.jukedeck.com/ 4.Boscaceoili: -This one requires a download in order to use it. Its a free software in which you can make your own music, thought It is recommended to watch some tutorials in order to be able to use it. One negative aspect might be is that it ha a messy interface. Get Boscaceoili: http://boscaceoil.net/ 5.Now into the sfx stuff, bfxr-retro: -In this software you can generate retro style sound effects for your game, tweak them to your needs, and use them. Simple. Get bfxr-retro: http://www.bfxr.net/ 6.Lmms: It's a piece of software, suggested by @SATORI which is also completely free. It takes some time to get a hang of it, but once you do, even if it lacks couple of features, it gets the job done! Get lmms: https://lmms.io/ TL;DR Out of all these softwares, audacity is a must, Jukedeck is the easiest with the best results and bfxr is the way to go with retro games.
  23. giltine528


    Its just an idea, but besides just killing the monsters you can also do objectives to spice up the gameplay. Like an arrow shows up where to go and for example you need to capture a point, or defend one, or like destroy an artifact of some sort. That would be pretty neat.
  • Create New...