How do I reset both an object's parent and child positions and rotations fully?
I have a gun, when it fires it plays an animation created in Unity's animation tab that includes moving and rotating both the parent and child objects independently to get the fire and reload anim looking just right (it's all in one full sequence), and I want to reset any rotation and position changes of both the parent and child/children back to default when I disable and then re-enable (SetActive = false to SetActive = true) the gun again, which I do when the player cycles through each of the weapons.
I think the actual animations themselves are resetting fine (as in the anim.play stuff), but the rotation and position changes that I made to actually animate the gun seem to be stuck in whatever position they were at when I disabled it (SetActive = false), and they remain like that when I re-enable it again (SetActive = true).
How would I go about resetting everything to the start states of both the parent and child/children properly (position and rotation) so that when I re-enable (SetActive = true) the gun again it all looks correct?
Your answer
Follow this Question
Related Questions
Actual animation not resetting after deactivating then reactivating object 1 Answer
Animations unwanted movement and rotation after updating 0 Answers
Problem with rotating object that has animator attached 1 Answer
Fixing Mirroring Humanoid Animations eyeballs 0 Answers
How to create a seamless looping animation, without noticing when the loop occurs? 1 Answer