how to get the point where 2 objects hitted?both obj has collider.

i am trying some physics test in script i can’t find any function which i can know which point the collider hitted.

Hi @irfanarik
This script will help you visualize hits.

Make sure you have rigidbody attached and use sphere without collider as the graphic game object.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CollisionColourSwitch : MonoBehaviour {

	public GameObject graphic;

    //function is called at collision
	void OnCollisionEnter(Collision coll){
                         //coll stores collision info
			for (int i = 0; i < coll.contacts.Length; i++) {
                            //create object graphic at place of every contact point
			        Instantiate(graphic, coll.contacts*.point, gameObject.transform.rotation);*
  •  	}*
  • }*