How To Move Colliders With Animation Unity 2d
- Spaces
- Default
- Help Room
- META
- Moderators
-
- Topics
- Questions
- Users
- Badges
- Home /
ii
How to update 2d colliders with spirte animation ?
Hello, I have attached a 2d collider to my game object, but when blitheness is playing the collider is not updating, tin can anyone tell me how to update collider with the animation? Cheers
4 Replies
· Add together your reply
- Sort:
10
Answer by thor348k · Jun 22, 2016 at 05:08 AM
By your question, I assume you already know how to make an animation, and add it to a controller.
When editing the animation, or when you're adding frames, you should notice the record button is selected. While this is gear up, you can change other properties for the controller's object. Which means, you tin adjust the collider size to fit, at each frame.
Colliders don't automatically adjust to fit the individual sprite frames.
Hope this helps! :)
1
Answer past shieldgenerator7 · Nov thirteen, 2017 at 07:54 PM
Yous take to add a Collider2D to the GameObject (such equally BoxCollider2D), and then on the animation pane, click the record push. Then for each frame you want to change the collider, click the "Edit Collider" button on the collider's component in the Inspector pane, and adjust it to what y'all demand.
The animation has no "collider" propety. The collider is a component on the GameObject that has the Animator.
Did yous try that? You can't record Polygon2D colliders!
1
Answer by Solitari · Jul 19, 2020 at 03:53 AM
I didn't imagine that unity had this trouble, it's not possible to brand fluid animation, because the box collider, a capsule collider or other doesn't follow the blitheness, and if you do step by pace, yous never tape properly, and when y'all record, you lot tape for others animations
0
Answer by awsapps · October 19, 2021 at 11:02 AM
Prepare as many kid objects every bit different colliders y'all have, for each one, place the collider to fit the animation. While animating, agile the respective child object...
Your answer
Welcome to Unity Answers
The best place to ask and answer questions about development with Unity.
To assist users navigate the site we have posted a site navigation guide.
If y'all are a new user to Unity Answers, check out our FAQ for more data.
Make sure to check out our Noesis Base of operations for normally asked Unity questions.
If y'all are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Follow this Question
Related Questions
Source: https://answers.unity.com/questions/1204815/how-to-update-2d-colliders-with-spirte-animation.html
Posted by: whitfieldlaysence.blogspot.com
Practise you know how you do that? Considering when I try to add a collider property to my animation, I can merely choose betwixt "Enabled", "IsTriggerd" and stuff similar that. I don't run across how I tin modify the collider somewehere. Would be groovy to get an answer, I really need it!
Hi thanks for your response, I've done exactly equally you said, but when I edit the collider to match the current sprite, it changes the collider to that for all the sprites (overwrites all other collider changes). I'm not sure what I'm doing wrong, any response would be appreciated!
Incorrect answer, you tin can't record changes in colliders such as Polygon Collider 2D :/