Search Unity

How human fall flat hands works?(SOLVED)

Discussion in 'Scripting' started by honzapat, Nov 5, 2017.

  1. honzapat

    honzapat

    Joined:
    Oct 3, 2015
    Posts:
    18
    i tried make a script that when something collide with hand collider it will joint it
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class HandConrtoller : MonoBehaviour {
    6.     public FixedJoint joint;
    7.     // Use this for initialization
    8.     void Start () {
    9. }
    10. void Update () {
    11. }
    12. void OnCollisionEnter (Collision collision )
    13. {
    14.   if(collision.gameObject.GetComponent<Rigidbody>())
    15.   {
    16.  
    17.    joint.connectedBody = collision.gameObject.GetComponent<Rigidbody>();
    18.   }
    19. }
    20. }
    21.  
    and it doesnt give me error but it also didnt work
     
  2. honzapat

    honzapat

    Joined:
    Oct 3, 2015
    Posts:
    18
    Solved unchecked is trigger
     
  3. Unity3DLoZ

    Unity3DLoZ

    Joined:
    Oct 4, 2018
    Posts:
    1
    Thank u for help =))