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 /
avatar image
-4
Question by AnaRhisT · Jun 24, 2010 at 01:23 PM · animationcollisioncharactercontroller

Collision - 2 Objects

I've 2 characters, they both have characterControllers and Capsule collider(with same radius and height - to fit the characterController collider style), I want to check if there's a collision between them, and if there's so the second character will play an animation too.(which is attack animation)

On my main hero :

function OnControllerColliderHit(hit : ControllerColliderHit)
{
        if(hit.collider.name.Contains("Lv"))
        {
                animation.CrossFade("attack1");
        }
}

On the monster :

function OnCollisionEnter(hit : Collision)
{
        if(hit.collider.tag == "Player")
        {
                animation.CrossFade("attack1");
        }
}
Comment
Add comment · Show 6
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 AnaRhisT · Jun 24, 2010 at 01:50 PM 0
Share

$$anonymous$$ike, ins$$anonymous$$d of editing lol, answer me! :<

avatar image Ashkan_gc · Jun 24, 2010 at 02:14 PM 0
Share

please provide more information. does it have an error. does unity call it or not? ...

avatar image AnaRhisT · Jun 24, 2010 at 02:47 PM 0
Share

Now, I put function OnControllerColliderHit(hit : ControllerColliderHit) and it does collide, but only when it moves.. I don't want it to collide just when it moves, I want a fast collision when there's a collision. which means - when the player hits the enemy when it's on move so they both will use animation.

avatar image Pirate___man · Jun 24, 2010 at 04:48 PM 0
Share

There are almost identacle threads. Search before you post!!!

avatar image AnaRhisT · Jun 24, 2010 at 05:09 PM 0
Share

Which one are you about? Also, almost isn't enough.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Ashkan_gc · Jun 24, 2010 at 02:10 PM

it seems that the problem is in another place like the name of the collider or the tag of the player. to make sure that the function is called use print and print the name of other collider and ... in less than a few month we will have a debugger wich will solve all problems like this easier. :) be aware that names are case sensitive.

Comment
Add comment · Show 1 · 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
avatar image AnaRhisT · Jun 24, 2010 at 02:13 PM 0
Share

Yeah I know, I'll put some debugs now, and what do u mean debuggers which will solve all problems? O_O

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

No one has followed this question yet.

Related Questions

Stop animation when character controller hits walls 1 Answer

Stop Root Motion if out of boundaries? Simple Wall Climbing System 1 Answer

How to have other (any) Objects smoothly push a Character Controller? 1 Answer

Pixel Perfection collision on 3d animated object 0 Answers

Character Controller surpassing Collider with iTween 0 Answers


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