Avoid physical collision between tagged gameObjects

This script avoid collision between 2  rigidbody/collider with a specified Tag name. Let’s create a new script :  and copy this into it: using System.Collections; using System.Collections.Generic; using UnityEngine;   public class avoidByTag : MonoBehaviour {   public string tagName;   void OnCollisionEnter(Collision collision){ if(collision.gameObject.tag == tagName){ Physics.IgnoreCollision(collision.collider, GetComponent() ); } }   }using System.Collections; using […]

Add a new script

Create a new script In the project directory, right-click in the directory where you want to create the script (It’s strongly advised that you make a directory called “Scripts” to get the best of it). Select “Create”, then select the desired language (c#, javascript). Then give the wanted name to your script.   Just double-click […]

Create a global event

Create a Global Event In the FSM window, go into the Tab “Events”. At the bottom write onto the “Add Event” input, the name of your event. Then you have created a new Event. To make it global, meaning that the event can be seen by other FSMs in other gameObjects, just check the little […]