Unity 3D Object Triggers

Published: 06 December 2014
on channel: Ryan Wallace
25,609
218

In this tutorial I show you how to make it when a object hits another it triggers something. This can be anything you wish. Hope you enjoy!

SCRIPT!
~~~~~~~~~~~~~~~~~~~~~~~~~~~
using UnityEngine;
using System.Collections;

public class Collide : MonoBehaviour

{
void OnCollisionEnter (Collision col)
{
if(col.gameObject.name == "trigger")
{
Destroy(col.gameObject);
//DO SOMETHING!

}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~


On this page of the site you can watch the video online Unity 3D Object Triggers with a duration of hours minute second in good quality, which was uploaded by the user Ryan Wallace 06 December 2014, share the link with friends and acquaintances, this video has already been watched 25,609 times on youtube and it was liked by 218 viewers. Enjoy your viewing!