Here’s a video of it:
The axes are physics objects with a trigger collider on the blade. When the trigger hits the target, the axe switches to kinematic (to disable movement) and becomes a child of the target.
As you can see, sometimes the axe just works like it’s meant to, but other times the axe rotates to some random angle.
Here’s the code for the axe if you’re curious:
void OnTriggerEnter(Collider col)
{
print(GetComponent<Rigidbody>().velocity.magnitude);
if (/*col.gameObject.tag == "Target" &&*/ GetComponent<Rigidbody>().velocity.magnitude > minimumStickSpeed)
{
transform.parent = null;
transform.parent = col.gameObject.transform;
transform.GetComponent<Rigidbody>().isKinematic = true;//.constraints = RigidbodyConstraints.FreezeAll;
}
}
There is no script on the target.
Any ideas on how to stop the errant rotating?