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
0
Question by SS2095 · Jan 08, 2014 at 06:13 PM · animationcollisioncollisiondetectiontransforms

How to make my player play a vault animation when i collide into a vaultable object?

i've made two animations,one jump and the other vault:jump should play when the player collides with a short object and vault when a tall one(with reasonable restrictions of course).i've tried using the OnTriggerEnter function to no avail.i'd like to attach the script to the player(so as to not have to attach it to every obstacle).i need to know what to use to make the obstacle initiate the appropriate animation in the player based on the transform values it returns to the script in the player(where i intend to use a condition checking height and width of the object).sorry if it looks like i'm rambling but i'm stuck and would really appreciate some help.

Comment
Add comment · Show 2
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 sath · Jan 08, 2014 at 10:03 PM 0
Share

are these obstacles are standard prefabs (shortPrefab for all short
objects and tallPrefab for all tall objects) or you have a terrain ?

avatar image SS2095 · Jan 09, 2014 at 08:48 AM 0
Share

the obstacles are not a part of the terrain

1 Reply

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

Answer by tanoshimi · Jan 08, 2014 at 06:14 PM

I suggest you study the Mecanim GDC sample project, which does exactly this: https://www.assetstore.unity3d.com/#/content/9896

Comment
Add comment · Show 3 · 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 SS2095 · Jan 08, 2014 at 07:31 PM 0
Share

how to implement collision detection without using raycast?i'd like to know.

avatar image tanoshimi · Jan 09, 2014 at 09:27 AM 0
Share

Use OnColliderEnter or OnTriggerEnter.

avatar image SS2095 · Jan 09, 2014 at 02:19 PM 0
Share

the way i'm doing it might be wrong but shouldn't those functions be used in a script attached to the obstacles and not the player.if it also works in a script attached to the player,it would be nice if you could just provide an example syntax. EXTRA INFO-i experimented with a script and an animation attached to obstacle itself which would play when the player entered it's collision bounds.i'm having trouble figuring out how to make the player himself detect collision and play the respective animation.hope that made sense to you

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

19 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 avatar image avatar image avatar image avatar image

Related Questions

Assist with CollisionDetection 1 Answer

Pixel Perfection collision on 3d animated object 0 Answers

Collision detection for sprite 1 Answer

Third Person: Picking up and carrying objects. 0 Answers

Collider on Bone changes Bone Origin/Pivot 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