Quantcast
Channel: Answers for "how to detect if one object is touching another"
Browsing all 8 articles
Browse latest View live

Answer by BPR

Hi, you are comparing a gameObject and a string, try to use col.gameObject.name or col.gameObject.tag instead Regards, BPR

View Article



Answer by Wrymn

You need to write it like this: function OnCollisionEnter(col : Collision) { if (col.collider.name == "Player" ) { Application.LoadLevel(1); } } or if you want to use it with TAG: function...

View Article

Answer by AcidDreamer

Thanks both for your answers.. It seems I cant set the unity correctly to behave according to the script...What I basicly did was adding this script to the a cube i wanted to use as a winpoint.. But...

View Article

Answer by Alzander2001

This is what i used for the next level portal: void OnTriggerEnter2D(Collider2D other) { if(other.gameObject.tag == "Player") { DontDestroyOnLoad(other.gameObject); Application.LoadLevel("ENTER...

View Article

Answer by BPR

Hi, you are comparing a gameObject and a string, try to use col.gameObject.name or col.gameObject.tag instead Regards, BPR

View Article


Answer by Wrymn

You need to write it like this: function OnCollisionEnter(col : Collision) { if (col.collider.name == "Player" ) { Application.LoadLevel(1); } } or if you want to use it with TAG: function...

View Article

Answer by AcidDreamer

Thanks both for your answers.. It seems I cant set the unity correctly to behave according to the script...What I basicly did was adding this script to the a cube i wanted to use as a winpoint.. But...

View Article

Answer by Alzander2001

This is what i used for the next level portal: void OnTriggerEnter2D(Collider2D other) { if(other.gameObject.tag == "Player") { DontDestroyOnLoad(other.gameObject); Application.LoadLevel("ENTER...

View Article

Browsing all 8 articles
Browse latest View live




Latest Images