Hello @simonbz , I use the Animation Rigging Package in my Project. I am initially only using the multi-parent-constraint to parent a Sword to the back of the character when not using the sword and parent to the hand of the character when using the sword.
I have properly assigned the target property, the source objects with the weight of BackRef initially 1 and that of the HandRef to 0, and also properly set up the Rigs and Rig Layers. I have set up a system to use the animation Events to trigger Methods and to adjust the weights if the sourceObjects on the multi-parent-constraint .And Infact all this was Fantastically working with a lot of performance. Thanks to the Animation Rigging Package.
Now the problem is I want several types of Swords as the user progresses throught the game. I am using the Game Foundation Package also, and it’s Inventory system to set up the properties of the Swords and find what type of sword the player currently has (lower power sword is progressively replaced by the higher power sword).
Therefore, no sword is in the Scene now. Then in the Script, I decide what sword to use, get it, Instantiate it with the position of the BackRef and the sibling of the multi-parent-constraint gameObject. Also, I assing the Instantiated Sword to the targetObject of the MPC(multi-parent-constraint), and all the reference fields of the Instantiated Sword too. The Sword is successfully Instantiated with the correct Position, Rotation and Parent. All the References were also Assinged correctly. I checked them in the Inspector.
When I pressed the Attack key before, it correctly played the Animation, the Animation event were fired, the weights of the MPC changed and the position of the Sword to the HandRef. And the same for putting the Sword also. But this was when the Sword was already in the Scene.
Now, when I Instantiate the Sword, I and press the Attack key, It does all the things as above, even changes the weights on the MPC (I double checked!). But the Sword doesn’t changes its position. Why?
I again isolated all the Sword Instantiation and placed the sword in the Scene and assigned all the Refs. I played the Scene and it Worked. The Sword got into the hands of the Character as before.
Why is this, does Animation Rigging doesn’t works on Instantiated Objects as Target.
I request a kind Help.
Regards
Harsh.