Question by
test19user66 · Jan 27, 2018 at 01:36 PM ·
animationunity 5playerplayer movementanimation editor
How can i grab object or player looklike Human:fall flat, gang beasts etc.
Comment
Best Answer
Answer by test19user66 · Feb 02, 2018 at 09:39 PM
Solved
public float Fuerza = 4000;
Rigidbody rb;
bool tomado = false;
// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody>();
}
void OnCollisionEnter(Collision col)
{
if (!tomado)
{
SpringJoint sp = gameObject.AddComponent<SpringJoint>();
sp.connectedBody = col.rigidbody;
sp.spring = 12000;
sp.breakForce = Fuerza;
tomado = true;
}
}
void OnJointBreak()
{
tomado = false;
}
// Update is called once per frame
void Update () {
}