Hi, I’m having trouble figuring out a script for making to different objects that attach to eachouther, I guess I’d need them to parent eachother but I’m unsure, can anyone help me please?
This is the approach I’ve taken.
function OnCollisionEnter(collision : Collision) {
var contact = collision.contacts[0];
var rot = Quaternion.FromToRotation(Vector3.up, contact.normal);
var pos = contact.point;
//collision
}
function Update () {
}
gameObject.tag = "Object";
//If the object collided with has the tag "Object" then attach to it.
//Then the attach code