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.

Johnideev

Newbie
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Johnideev

  • Rank
    Newbie
  1. You even made video for me Thanks man. Its worked like charm
  2. Learning Raycast now (For real) And im also waiting for your script.
  3. Thats what i need ^'> Can you please show me how? (Yeah i know i must do it myself,but im wasting time with this in this problem i dont know how to get out) And i cant find this script in fps kit.
  4. Okey its worked,but realy buggy for me (sometimes it just not destroyed player),so i like the other way it is possible only with your help...I tested out this script: function Update () { var fwd = transform.TransformDirection (Vector3.forward); if (Physics.Raycast (transform.position, fwd, 10)) { print ("There is something in front of the object!"); } } It detects EVERYTHING what is in raycast way,and always prints out: "There is something in front of the object!" because it detects everything,every object,every obstacle....well is it possible that it only detects player when he walks in raycast way,not all world objects,but player only.... How to make this detects only player: if (Physics.Raycast (transform.position, fwd, 10)) { Please help me
  5. Thank you OneManArmy for that now i understand something Anyway you see this line: if (Physics.Raycast (transform.position, fwd, hit, 1000)) { // 1000 = raycast start point till end point i have light like flashlight,like laser...well that line of code detects everything what is on its way like walls,obstacles,objects,everything.....I want that script line only detects player (ME),how can i do that? How can i remake the script that its only detects me not everything from world....Please help me
  6. Ohhh.....this script: function Update () { var fwd = transform.TransformDirection (Vector3.forward); if (Physics.Raycast (transform.position, fwd, 10)) { print ("There is something in front of the object!"); } } Works perfect,i understand this script,but i dont know how to modify it,where to put Destroy player command and make it work...Thats only problem. (just need to destroy player with tag: Player)
  7. Hi, this script should work if (Hit.collider.tag == "Enemy"){ Destroy(Hit.collider.gameObject); } your mistake was at "Hit.collider.gameobject.tag", it should be "Hit.collider.tag" I need full script,just showed example what needs to be included in script
  8. Hi,this is my first topic here Anyway can you guys please help me at raycasts,its my first time working with them,so i just need script (Request) i want my player destroys when he touches raycast,like: if (hit.collider.gameObject.tag == "Player") Destroy(hit.collider.gameObject); Can someone please help me,dont know anythng about this.Please someone help me...Ill be very thankful.
×
×
  • Create New...