How 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 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 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 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 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 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 ArticleRotation with Raycasting
WHen I rotate my raycast doesn't rotate as well. why not? transform.Translate(Vector3.forward * Time.deltaTime * speed); //transform.Rotate(transform.right * Time.deltaTime * 5);...
View ArticleRaycast not drawing
Hey guys. I'm trying to dig my way into raycasting and I'm having a hard time drawing it for debugging.Currently the ray works the way intended, but it doesn't draw it with Debug.DrawRay. here is my...
View ArticleDraw a Ray to the Mouse Postion
I'm trying to draw a ray to the mouse position from my player but it is acting very strange. Firstly the whole ray isn't even where the mouse is but if I use Debug.DrawLine instead of Debug.DrawRay...
View ArticleRays drawn using Debug.DrawRay "fall" in editor view
I'm casting five rays from my camera to determine where camera is looking. I'm also using Debug.DrawRay to make them visible in editor mode. However, when I run the game and switch to editor something...
View ArticleRaycast and drawray problems
Hello... Im making a FPS on C# and im having some problems with the Raycast. Vector3 fwd = direction.transform.position; RaycastHit hit; if (Physics.Raycast(fwd, transform.forward, out hit)) ; {...
View ArticleDraw af line in a specific angle around an object
Hi. I have a transform which I can draw a Ray from using e.g. Gizmos.DrawRay. My problem is that I don't know how to define an angle instead of a direction. E.g. I can understand that transform.forward...
View ArticleRayCast "blueline" qoes down
Hallo. I want to create FPS. I was finding gun shoot script for 2 days. I found narutoisgreat1234's Raycast shoot script. Here is it with my small modifications. :` var Range : float = 1000; var Force...
View ArticleVector direction to point
How do i convert Debug.DrawRay to LineRenderer? var lineRenderer : LineRenderer = GetComponent(LineRenderer); var aimEnd2 : Vector3; aimEnd2 = (aimStart - currentTouchPos).normalized; Debug.DrawRay...
View ArticleDebug.DrawRay from camera
Hi. I'm fairly new to unity and have been on it for a couple weeks now. So I'm currently trying to draw a ray from my camera to wherever I click. I've got the ray barely working. I see the ray only in...
View ArticleProblem With Physics.Raycast
Hi, I am trying to create a Ray from my MainCamera to my Player Here is the code I used... -------- var target : Transform; function Update () { Debug.DrawRay(transform.position, target.position); if...
View ArticleRotate From SpawnPoint TO Transform Rotation
Hello Everyone i Got Problem With Shooting Bullet its shoot from the spawnPoint [Weapon] To Forward i actually need it to shoot from SpawnPoint To Forward but with rotate Lemme Show You This Photo,...
View ArticleLayerMask, DrawRay and DrawLine acting weird...
Ok, so I am getting some odd results when I use Physics.DrawRay(). I have created a function for detecting collisions with other game objects on Layer 10. Unfortunately, while the ray passes through...
View ArticleRaycast doesn't work properly?
So my camera throws a Raycast forward, and if this raycasts target hits a specified target, i want it to tell me. Very simple. Altough, it doesn't seem to always tell me when the target gets hit even...
View ArticleDrawRay with a custom class.
I have 2 simple scripts witch have to dray a ray from an objects position upwards but it dosent do anything, --the class witch draws the ray #pragma strict class aClass { var pos : Transform; function...
View Article