Debug.DrawRay line increases every frame
Hi everyone. I have an interesting problem. Debug.DrawRay / DrawLine increases in length each frame, thus passing through objects. But when it touches the real distance, it disappears. The problem is...
View ArticleRaycast registering hit when the player touches the target gameobject
I'm kinda new in unity and still figuring out few things. in this project I'm trying to do things when the raycast hit the target but it does not registers the hit when the ray hits the target but...
View ArticleHow do I draw rotated rays from an object?
I've been wracking my brain on this one for a few days. I have the need to have a script where I can specify a list of rotations and I wanted to draw rays from the object to point out from the object...
View Article2D TDS Raycast: Drawray vs Line Renderer.
Hello, still really green when it comes to coding. I'm making a 2D Top Down Shooter and one of my guns uses raycasting. I want to see a line in game view of where the bullet is going. It looks great...
View ArticleDrawRay position && local/world position ERROR
Was trying to get the transform.position of the top face on a mesh (X0, Y0.5, Z0) Was getting some mistakes and tried to debug with 2 Draw Rays DrawRay 1: Debug.DrawRay(TopFaceMid, Vector3.up * 0.4f,...
View ArticleDebug.DrawRay not drawing Ray
I went through multiple posts trying to find the answer for this, but nothing has worked. I attached a script with this Update method void Update () { RaycastHit hit; Ray putterRay = new Ray...
View ArticleMake Ray visible
I want to make a railgun/instagib rifle variant of my raycast shoot script, How do I make the bullet ray visible ? [RequireComponent(typeof(AudioSource))] public class TestScript : MonoBehaviour {...
View Articledraw ray weird outcome.
Hi Guys, I have been trying to do this for a couple of days now and cant seem to get this to work so went back to the drawing board and realised that the "enemy" does move towards the player when...
View ArticleRayCast2D and RayDraw errors
Okay I am making a 2D Platformer Side Scroller. I am working on a AI / COM player right now who should jump when there is an obstacle in front of him (detected by the Red raycast) or if the ground in...
View ArticleDebug Draw for BoxCast and CapsuleCast
I am looking for debug draw related help for BoxCast and CapsuleCast so it become useful in programming rather than doing just guessing. I found that for RayCast, there is DrawRay available for giving...
View ArticleHow to place an object in the direction of a raycast
![alt text][1] [1]: /storage/temp/108238-capture.png Hi there, I am trying to place a transform object in the position of the end point of a ray. As you can see that the yellow line was drawn using the...
View ArticleDrawRay not drawing a ray
Hi, When my character lands on a bomb trap I want a ray to be cast to assess the objects around the character which will determine how and where he is flung. I am trying to use Debug.DrawRay in order...
View ArticleCall an exorcist.
Whenever I start up my game and move the camera my character gets possessed and break dances (I can't get a clear screen shot of it but the orange lines are a drawray from my camera so you can probably...
View ArticleDrawRay Hits but RayCast does not
Hello, I have this script which should create a raycast and print the exact line of the raycast. Debug.DrawRay(this.transform.position, new Vector3 (1, 1, 0)*7,Color.red,3.0f); RaycastHit2D hit =...
View ArticleAdd layermask to DrawLine & DrawRay or something similar with visible Ray
I want to test my Ray but like all good rays, I need a layermask. Unfortunately, Unity does not add this option for their debugs for RayCast, DrawLine & DrawRay. How can I find a work around for...
View ArticleHow to make Debug.Drawray visible in game?
Hello. Is there any way to to make the Debug.DrawRay function visible in-game and not just in the editor? Or what alternatives are there to the debug.drawray function? This is the code i'm using and...
View ArticleHow can I draw a specific distance with Debug.Drawray
I have this issue: I'm using Physics2D.Raycast as next: RaycastHit2D hit_der = Physics2D.Raycast (transform.position+new Vector3(transform.localScale.x/2,0,0),Vector3.right,1,10); RaycastHit2D hit_izq...
View ArticleRaycast from transform.position to Player.transform.position is not...
I did Debug.DrawRay (transform.position, PlayerGet.transform.position);
View ArticleWhat does direction do for a physics.raycast besides direction? (read details)
When you use Debug.Drawray it's direction parameter also sets the ray's length (like writing Vector3.forward * 10). Physics.raycast has a separate ray length setting, but what does multiplying it's...
View Articlemaking Debug.DrawRay infinitely long using Mathf.Infinity
void Update () { Debug.DrawRay (transform.parent.position,transform.parent.forward*Mathf.Infinity); } I have this code, and the ray does not display in the editor. However, when I use the code below,...
View Article