Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Aug 14, 2013 at 03:43 PM by clunk47 for the following reason:

Self resolved issue.

avatar image
0
Question by galaboy · Aug 09, 2013 at 01:38 PM · collision

problem with collision detection

my scene is, my player shoots prefab (bullet) and when it hits an object with tag name blocks the prefab has to get destroyed.i ahve added rigid body component for the prefab and checked on istrigger on another object which is in the bullet's path. the problem is i dont see any collision detection when the bullet hits any object that has tag name blocks. the script is as follows.

using UnityEngine; using System.Collections;

public class projectile : MonoBehaviour {

 public float projectileSpeed = 2f;

 // Use this for initialization
 void Start () {
 
 }
 
 // Update is called once per frame
 void Update () 
 {
     float amtToMove = projectileSpeed * Time.deltaTime;
     transform.Translate(Vector3.right * amtToMove);
 }
 
 void OnTriggerEnter(Collider otherobject) 
 {
    if(otherobject.tag == "blocks")
     {
         Debug.Log("iam hit");
     }
 }

}

need help...

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image clunk47 · Aug 09, 2013 at 03:29 PM 1
Share

For any fast moving rigidbody, set collision detection to ContinuousDynamic. For any rigidbodies this bullet will be hitting, set to Continuous.

$$anonymous$$ore information on Collision Detection $$anonymous$$ode HERE

avatar image clunk47 · Aug 13, 2013 at 05:08 AM 0
Share

please let us know if your issue has been resolved.

avatar image galaboy · Aug 14, 2013 at 11:00 AM 0
Share

YA THAN$$anonymous$$ YOU THE PROBLE$$anonymous$$ GOT SOLVED.THE PROBLE$$anonymous$$ WAS I ADDED RIGID BODY TO THE PREFAB AND DIDN'T CHEC$$anonymous$$ OFF IS$$anonymous$$INE$$anonymous$$ATICS.

avatar image clunk47 · Aug 14, 2013 at 03:43 PM 0
Share

As a future reference: If you solve a problem on your own, please post your resolution as an answer so that others can see the solution. Then close the question, so that people like me don't try to answer it, then bug you about it lol.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

How to check if an object is colliding with another from another script ? 1 Answer

Endless DeathZone??!!? 4 Answers

super mario pipe physics? 1 Answer

Script is stuck in OnCollisionStay 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges