Resources
Answers
Examples
Sign in
Get Started
What do you want to save?
Add Code snippet
New code examples
C#
2021-10-16 07:00:06
raycasting in unity
RaycastHit hit; // Does the ray intersect any objects excluding the player layer if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, Mathf.Infinity, layerMask)) { Debug.DrawRa...
Add solution
C#
2021-10-16 05:59:06
how to zoom where i have mouse cursor in unity
public float zoomSpeed; public float minZoom; public float maxZoom; void Update() { Zoom(); } void Zoom() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit point; P...
Add solution
C#
2021-10-14 14:27:07
2D mouse angle in 360 degrees?
//There are 3 ways frist two are for platform last one for topdown works in 2 public class FindAngle : MonoBehaviour { public GameObject goPlayer; void Update() { Vector3 v3Pos; float fAngle; if (Input.GetMouse...
Add solution
C#
2021-10-14 00:29:08
getcomponent c#
//First script public class Enemy : MonoBehaviour{ public int health = 10; public void saySomething(){ Debug.Log("Hi, i am an enemy."); } } //Second script //There is one thing though, //if the script is located on another gameobjec...
Add solution
C#
2021-10-11 18:50:04
raycast unity
RaycastHit hit; // Does the ray intersect any objects excluding the player layer if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, Mathf.Infinity, layerMask)) { Debug.DrawRa...
Add solution
Python
2021-10-10 12:09:09
how to use raycasting python
how to raycast python
Add solution
C#
2021-10-08 12:37:06
unity ui doesn't block raycast
private bool IsOverUI(TouchState touch) { PointerEventData pointerData = new PointerEventData(EventSystem.current); pointerData.position = touch.position; List<RaycastResult> results = new List<Raycast...
Add solution
C#
2021-10-07 05:46:04
how to know on which a gameobject is RaycastHit located
if (Physics.Raycast(cam.ScreenPointToRay(...), hit){ Destroy(hit.transform.gameObject); }
Add solution
C#
2021-10-05 20:47:02
unity3d raycast
RaycastHit hit; // Does the ray intersect any objects excluding the player layer if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, Mathf.Infinity, layerMask)) { Debug.DrawRa...
Add solution
C#
2021-10-02 05:55:03
how to see a tag of what you hit with raycast
if (Physics.Raycast (transform.position, fwd, hit, Reach) && hit.transform.tag == "TagName") {
Add solution
‹
1
2
3
4
5
6
›
Best helpers
daily
weekly
monthly
for 3 months
Peace LX
+5
Vaishal Patel
+5
Peter N
+5
show more
This website uses cookies to make IQCode work for you. By using this site, you agree to our
cookie policy
Welcome Back!
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign in
E-mail
Password
Recover lost password
Log in
Or log in with
Not registered?
Sign up takes less than a minute
Create a Free Account
Sign up to unlock all of IQCode features:
Test your skills and track progress
Engage in comprehensive interactive courses
Commit to daily skill-enhancing challenges
Solve practical, real-world issues
Share your insights and learnings
Sign up
Email
Password
Sign up for free
Or sign up with
By signing up, you agree to the
Terms and Conditions
and
Privacy Policy
. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.