- Home /
How to implement a Hit Test?
Hi guys,
Im new to Unity. Im trying to set up two objects to collide with each other but im having trouble writting the code.
Is there anyone who can help with script or a link to a tutorial?
Im using C sharp
Cheers
Answer by qJake · Jul 27, 2010 at 05:22 AM
You don't code collisions, they happen automatically. You just need to add a Collider component to your game objects that you want to collide.
http://unity3d.com/support/documentation/Components/class-BoxCollider.html
That's the reference for a BoxCollider, one of the common types of colliders.
If you're new to Unity, read through some of the links here:
http://answers.unity3d.com/questions/4897/how-can-i-start-learning-unity-fast-list-of-tutorials
Your answer
![](https://koobas.hobune.stream/wayback/20220613065755im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
guiText.HitTest(Input.mousePosition) is not triggering 0 Answers
How to create a LIST of hit.colliders? C# 1 Answer
Guns don't shoot straight. 3 Answers
Normal to Quaternion (relative to origin of hit object) 1 Answer
intelligent throwing 0 Answers