Debug.Log issues

He meant the same as I. Since the name Collision already exists in this context, it is advisable to rename the class and the file.

public class Collision : MonoBehaviour could be changed to public class CollisionHandler : MonoBehaviour. The file must be renamed to ‘CollisionHandler.cs’ because that’s a requirement by Unity.

If you follow a course and the instructor uses the name Collision for his own classes in his project, you use CollisionHandler for your own classes in your project. If the instructor uses Unity’s Collision class, you too use Unity’s Collision class.


See also:

1 Like