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

  • Last visited

  • Days Won

    139

Everything posted by geckoo

  1. geckoo

    Code JV for dummies

    I did not presume to judge the work of others. I try to understand some methods, best among the others. What you tell me is very relevant, and I imagine the need to monitor the behavior of functions when debugging. It makes sense. Thank you for these explanations + +
  2. geckoo

    Script help.

    It's cool for an ambiant sound like a music... There is an alternative if your player (or collider) emit a localized sound when he passes nearby the trigger. var sound : AudioClip; function OnTriggerEnter(otherObj: Collider){ if (otherObj.tag == "Player"){ AudioSource.PlayClipAtPoint(sound, transform.position); yield WaitForSeconds(audio.clip.length); }
  3. geckoo

    Fps kit 2 SentryGun Script

    If you had a bit searched on the forum, you would have seen that I wrote a text about this script yesterday. http://armedunity.com/topic/5002-loop-in-update-function/?hl=loop
  4. geckoo

    Question about fonctions

    Спасибо за предложения. Я сталкивался с трудностями, пробуя определить некоторые слова из твоего текста, но мне кажется, что я понял самое главно - практиковать каждый день "чуть-чуть" и в конце концов можно достичь своей цели - владеть кодом JV. На самом деле, читать/понять его очень легко. Можно ещё изменить некоторые аспекты кода и попробовать разные варианты. Но к сожалению, создать какой-то полный код - то есть размышлять точно и обрести логику, чтоб созидать сложный код - это другое дело. Они говорят по-русски свободно в Латвии. Я не знал. Огромное спасибо тебе за советы ++ I found a really good example. It's very explicite : function PlayStepSounds () { var controller : CharacterController = GetComponent(CharacterController); while (true) { if (controller.isGrounded && controller.velocity.magnitude > 0.3) { audio.clip = walkSounds[Random.Range(0, walkSounds.length)]; audio.Play(); yield WaitForSeconds(audioStepLength); } else { yield; } } }
  5. geckoo

    Question about fonctions

    Трудно мне уже отличать этот метод от других. Даже если я понял теорию, есть ещё практическое упражнение. Продолжаю искать и вы знаете выражение - кто ищёт, тот найдёт... Прежде всего, я решил исследовать аккуратно код из fps_tutorial. Этот исходник очень интересен ++
  6. geckoo

    Question about fonctions

    На самом деле, я только попробовал понять этот принцип. Я не создал ничего особенного. Я исследовал код и я заметил много аспектов, которые можно изменить/совершенствовать. Чтоб сделать эти изменения, я должен обязательно понять как всё идёт - как один код соединяется с другими... вот почему я задал вам такой вопрос. Спасибо за помощь ++ I try to understand how this code was developed and how i can modify many details (it's a begining). It so confused for me and i have so many questions... I was coder - ASM and C/C++ - rootkit, BOF, backdoor, shellcode - an another world, but I forgot many lessons. I work on it. Thanks boys because you helped me.
  7. geckoo

    Question about fonctions

    That will work only if both script are attached to the same gameobject. ...and this is why I did not understand your explanation. Thanks you very much for help ++
  8. geckoo

    Question about fonctions

    Ok I understood : var lol : scriptX = GetComponent(scriptX); lol.functionX(); lol.variableX ++; etc... Thx for support. It's a new language for me ++
  9. geckoo

    Question about fonctions

    NullReferenceException: Object reference not set to an instance of an object Hum... i don't understand something I read the tutorial ++
  10. geckoo

    Question about fonctions

    SendMessage "function-name" has no receiver! I forgot something... I don't understand boys. Can you explain to me? I try second method with GetComponent. Thx ++
  11. geckoo

    Question about fonctions

    Thx for support I don't have to call something in script to attach this second script at first? I try it ++
  12. geckoo

    loop in UpDate function

    Full code if you wanna read it and comment it (SentryGun.js by OMA in fps_tutorial - original code by Joachim Ante). Replace the original code, find a sound and try it ++ @script RequireComponent(AudioSource) var attackRange = 33.0; var shootAngleDistance = 15.0; var target : Transform; var detected : AudioClip; var audioAlarmLength = 2; var countdown = 1; // 2 or 3 for an echo effect with the alert sound // who is my target? - i am function Start () { if (target == null && GameObject.FindWithTag("Player")) target = GameObject.FindWithTag("Player").transform; } function Update () { if (target == null) return; if (!CanSeeTarget ()) return; // Oups! Turret see us // Rotate towards target var targetPoint = target.position; var targetRotation = Quaternion.LookRotation (targetPoint - transform.position, Vector3.up); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 2.0); alertOn(); // alternative 1 (my choice) // If we are almost rotated towards target - fire one clip of ammo var forward = transform.TransformDirection(Vector3.forward); var targetDir = target.position - transform.position; // Angle OK - shoot him! if (Vector3.Angle(forward, targetDir) < shootAngleDistance) { SendMessage("Fire"); // alertOn(); // alternative 2 } } // alt 1 - this function emits a sound when the turret see the player (or) // alt 2 - this function emits a sound when the turret send a "fire" message (or) // alt 3 - this function emits a sound when the turret can see the player (make the difference with first alternative) function alertOn () { if (countdown == 0) return; else AudioSource.PlayClipAtPoint(detected, transform.position); countdown --; // to avoid too many sound in process (update function causes this annoying effect) yield WaitForSeconds(audioAlarmLength); countdown ++; // again } function CanSeeTarget () : boolean { // Player is too far of her enemy (no danger) if (Vector3.Distance(transform.position, target.position) > attackRange) return false; // In an other case, turret shot him because player is too near of our turret var hit : RaycastHit; // alertOn(); // alternative 3 // if you prefer, you can call function alertOn when the turret can see the player. if (Physics.Linecast (transform.position, target.position, hit)) return hit.transform == target; return false; }
  13. geckoo

    loop in UpDate function

    Hello. I have a problem of understanding, which I would submit to you. I want to add a sound on this script to trigger an alert. I created a function for sound and it works ... but as an annoying loop because I'm in the Update function. Inevitably I end up with a lot of appeal to this function. So chaos. I am looking for a way to create a condition on this function so that it is played once. What do you think? THX friends ++ Tutorial_fps (by OMA) function Update () { if (target == null) return; if (!CanSeeTarget ()) return; // Oups! Turret see us // Rotate towards target var targetPoint = target.position; var targetRotation = Quaternion.LookRotation (targetPoint - transform.position, Vector3.up); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 2.0); // If we are almost rotated towards target - fire one clip of ammo var forward = transform.TransformDirection(Vector3.forward); var targetDir = target.position - transform.position; // Angle OK - shoot him! if (Vector3.Angle(forward, targetDir) < shootAngleDistance) { SendMessage("Fire"); alertOn(); } } function alertOn () { AudioSource.PlayClipAtPoint(detected, transform.position); return; }
  14. geckoo

    loop in UpDate function

    Finally i found this way, but i don't know if it's really professional In the meantime, it works pretty well ++ var countdown = 1; // or 2/3 for an echo effect function alertOn () { if (countdown == 0) return; else AudioSource.PlayClipAtPoint(detected, transform.position); countdown --; yield WaitForSeconds(audioAlarmLength); countdown ++; }
  15. geckoo

    Orb - FinalPK0.85

    Ok I understand. Thanks for this idea ++
  16. geckoo

    Orb - FinalPK0.85

    Hi all. I try to use in an empty project the amazing Orb (FinalPK0.85). I don't understand how i can attribute the target. In original project, it's really clear, but i can't reproduce this process with a simply "First Person Controller". Must I specify the camera's position or an other parameter? Thanks ++
  17. geckoo

    Orb - FinalPK0.85

    Orb would look much better if I replace it with this drone? Ok. I try... But it will be more efficient? It's an other script? It's the same IA?
  18. geckoo

    Orb - FinalPK0.85

    It's alright. I found my mistake and I fixed it. It's a silly taping error when i wrote the name of the empty object - TargetPoint (мне позор). Sorry for the inconvenience. I lost many precious time for this stupidity. Как говорят, у всех так бывает... This script is really cool with a funny movement and effect when Orb chasing. It's most than a simply turret and It conserves again an IA interesting - rudimentary, but efficient. Thx ++
  19. geckoo

    Simple FPS - Update #1

    It's a (bad) habit to end my tickets like this. It's possible to translate it by "see you later alligator" Oups i forgot ++
  20. geckoo

    Simple FPS - Update #1

    Very impressive. It's a good work ++
  21. geckoo

    7dFPS 2013

    You can find on this page the result of last 7dFPS. A lot of this games are developed on Unity, and some are strange. There are good ideas ++ Вы можете в этой странице обнаружить много игр, которые были созданы посредством Unity. Результат интересен. Попробуйте братья ++ http://7dfps.com/?action=games&sort=most_likes
  22. Exactly. We often make this mistake when we start in programming, forgetting gap/ratio with the resolution of screen. The difference is important. Thank you for free distribution. This code is really usefull ++
  23. geckoo

    Can't get A* Pathfinding to work

    Oki thx for this link ++
  24. geckoo

    Can't get A* Pathfinding to work

    Hi all! I don't understand how i can redefine a new grid to use the A* Path Finding. In the map Arena (FPS Kit premium 0.85) i create a simple bridge (not an obstacle), but spiders don't change the way. I thought that A* recalculate all the zone to find the better way. Maybe you can explain to me. Thanks you ++ Чёрт! Я сталкиваюсь с трудностями, чтоб понять принципу, но продалжаю искать решение. Помогите пожалуйста. Спасибо ++
  25. geckoo

    система

    Так и есть. Само собой разумеется браток
×