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.

giltine528

Member
  • Content count

    439
  • Joined

  • Last visited

  • Days Won

    3

giltine528 last won the day on February 24 2017

giltine528 had the most liked content!

Community Reputation

75 Excellent

About giltine528

  • Rank
    Member
  • Birthday 11/03/1997

Profile Information

  • Gender
    Not Telling
  • Location:
    Lithuania

Recent Profile Visitors

729 profile views
  1. Melee system that uses triggers?

    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.
  2. Melee system that uses triggers?

    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!
  3. Getting variables from base class? c++

    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?
  4. Help with math a bit

    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.
  5. Dashing when looking at nothing?

    True, that worked heh, on the other note, is my method of dashing done correctly or there is a better way?
  6. Dashing when looking at nothing?

    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) { } } } } }
  7. 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.
  8. Abaddon

    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.
  9. Abaddon

    Very interesting project, hope to see some more progress video in the future, keep it up!
  10. Agent questions

    That worked perfectly, thanks mate!
  11. Agent questions

    So this problem occured to me. I want all of the agents to attack different parts of the wall, but they instead focus on the center of the model so it ends up like that, any advice, I use raycast to make them stop when they hit the wall, so maybe I can make like 3 destinations and pick a random one?
  12. How to solve this problem? c++

    Yeah i solved it, I simplified the formula. Then as you can see b-phone number digit is between the interval of 0-9, and the c-age is between 1-100. In those two loops you use simplified formula and see when(idk how to say it in english) there are no numbers after comma(like 2.00,500.00, and 2.05, 500.30 would be bad) after that we have our b and c. What is left is a and we get it after putting b and c into formula. And poof, we are done.
  13. Why an alternative to std:find does not work?

    "Loopception now in theaters! Will the main protagonist be able to escape a loop in loop that is in another loop."
  14. Why an alternative to std:find does not work?

    "i" is The loop of all loops, the beginning which adds a new element to the "a" with a formula and "l" is the loop which adds numbers to the "b" array that are missing in the "a" array. So thats why i am checking if the element that I am adding to "b" array exist in "a" array or not #include <iostream> #include <algorithm> // for std::find #include <iterator> // for std::begin, std::end using namespace std; int top(int stack[]) ; int main(){ int n, a[10000]={0,2,3,4,7,13,15},b[10000]={0,1,5,6,8,9,10}, b_count; bool lol; cin >> n; if(n<7) { cout << a[n] <<"_" <<b[n]; } else{ for(int i=7;i<=n;i++) { if(i==7) b_count=7; a[i]=b[i-1]+b[i-3]; int sk=a[i]-b[b_count-1]; //cout << "A[i]-" << a[i] << " sk" << sk << endl; for(int j = b_count; j <b_count+sk;j++) { int check=b[j-1]+1; b[j]=check; } //Checking for(int l = b_count; l <b_count+sk;l++) { bool exists; for(int e=0; e<=i;e++) { if(b[l]==a[e]){ exists=true; break; } } //bool exists = find(begin(a), end(a), b[l]) != end(a); if(exists) { for(int k=l;k<b_count+sk;k++) { b[k]=b[k+1]; } sk--; } } cout << i << "-"<<a[i] <<"_" <<b[n] << endl; b_count+=sk; cout<<"BCOUNT "<<b_count<< endl; } // cout << b_count; } for(int i=0; i<=n;i++) { cout<<"a-"<<a[i]<<endl; } for(int i=0; i<b_count;i++) { cout<<"b-"<<b[i]<<endl; } return 0; }
  15. How to solve this problem? c++

    Its one of my homework questions that i cant solve. I need to program it in c++;
×