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 bls61793 · Apr 26, 2017 at 11:03 AM · 2d2d game2d-platformer2d-physics2d animation

What is the best/easiest way to align a 2D rigidbody to specific sections of a sprite?

I have a very basic 2D platforming character that I have created from a sprite-sheet. I have created animations and a state-machine (animation controller) for the character, such that the character can currently move/attack properly and the animations play appropriately.

My character has a "punching" animation, and I would like to attach a rigidbody 2d to his hands so that the location of the rigidbody matches the hands, even during the animation. I know I could do this in script by meticulously tracking numbers, but I first wonder if there is an easier way.

Does anyone know how to accomplish this cleanly?

Comment
Add comment · Show 1
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 oranmooney · Jul 06, 2017 at 05:18 PM 0
Share

I Personally am not aware of any easier way, but the way i would approach this is by placing a ... hold on a rigidbody(i thought you meant Collider), sorry mate i read this wrong. ow well good luck. By thinking of it what would this be used for, what sort of effect are you looking for ?

@bls61793

Hopefully there is a way. Sorry if i am wasting your time.

1 Reply

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

Answer by bls61793 · Aug 04, 2017 at 04:57 PM

It's all good mate.

Coming back to this question after some time. I discovered that I was actually talking about a circle collider at the time that I posted this question.

Being a noob I didn't realize this when I posted, but I learned that it is possible to use the animation system in Unity to animate colliders just like any other game object (so you can have a collider follow the animations exactly).

This means if you already have collision logic on your collider, it will fire as the collider moves with the animation. So to anyone reading this question, I would look into Unity Animation, and try including keyframes for your colliders in your animations.

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

Two Polygon2D Collider do not Collide with Each Other (Solved) 2 Answers

My ground checker only works... sometimes 1 Answer

How to make slider joint immovable by the player 1 Answer

simulate gravity in a 2D game 3 Answers

How do I stop my sprite from jumping in the air? 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