Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
avatar image
0
Question by yvyv1000 · Jul 29, 2016 at 07:00 PM · animationscripting problemcollisioncollision detection

object isn't detecting collisions

so I have this script

 var NifeDamage = 60;
 
 function Start () {
         Throw();
 }
 
 function Throw(){
         GetComponentInParent.<Rigidbody>().AddForce(transform.parent.forward * 1000);
         GetComponentInParent.<Rigidbody>().useGravity = true;
         GetComponentInParent.<Animation>().Play("Nife");
 }
 
 function OnCollisionEnter(collision : Collision){
     Debug.Log("Hit something");
     GetComponentInParent.<Animation>().Stop("Nife");    
 
 }

in theory it should stop the Nife animation when detecting a collision but for some reason it just keeps repeating the animation over and over the animation is set to loop but I don't know how to keep the animation going through scripting does anyone have a idea?

Comment
Add comment · Show 5
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 yvyv1000 · Jul 29, 2016 at 12:52 PM 0
Share

also the log isn't returning Hit something either and the nife is using a mesh collider and is convex

avatar image tanoshimi · Jul 30, 2016 at 03:18 PM 0
Share

Is the collision being registered? Does "Hit something" get printed to the console? What rigidbody/collider settings do you have?

avatar image yvyv1000 tanoshimi · Jul 31, 2016 at 12:13 AM 0
Share

no hit something is not getting printed and for the collider settings the nife itself has a mesh collider and is convex but the objects that its colliding with arent convex but they don't have to be if im right because only 1 of the objects needs to be convex when using a mesh collider

the nifes rigidbody is the normal settings of a rigidbody but gravity is off til the script starts running as you can see(this due strange movement behaviour when it being on when the script wasn't running)

avatar image tanoshimi yvyv1000 · Aug 01, 2016 at 03:04 PM 0
Share

Right, so your problem has nothing to do with animation then, and your animation loop settings are irrelevant.

So, you have: - Object A with convex mesh collider and rigidbody (not kinematic) - Object B with non-convex mesh collider?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by yvyv1000 · Aug 02, 2016 at 12:00 PM

fixed it by making it a trigger and then using a small box collider not set as trigger to keep it from going through stuff

Comment
Add comment · Share
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

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Having problems with obstacle collision killing the player 1 Answer

Player Hit Physics implementation using 2D Animation Frames 0 Answers

2D Platformer - Action When Key Is Pressed During Collision C# 0 Answers

Strange issue with collider 1 Answer

Rigidbody trapped in collider after collision 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