Quantcast
Channel: Questions in topic: "drawray"
Browsing all 92 articles
Browse latest View live
↧

Raycast won't hit Collider

I trying to build a point and click system where the point i click will become destination point for the NavMeshAgent. Here is the code i am using: if (Input.GetKey (KeyCode.Mouse0)) { ray =...

View Article


How to calculate Debug.DrawRay length to match raycast

Hi everyone, I've come across a bit of a problem. I am trying to work with some rays however when I tried to add a visual element to it I noticed something was wrong. I realize that you assign a length...

View Article


Why doesn't the distance in RaycastAll and DrawRay correspond?

Hi! My problem is that the length/distance of the ray drawn is not the same as the ray being cast, even though the numbers are the same. The ray is only as long as about 2/3 of the ray that is shown....

View Article

making 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

What 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 Article


Raycast from transform.position to Player.transform.position is not...

I did Debug.DrawRay (transform.position, PlayerGet.transform.position);

View Article

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 Article

How 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 Article


Add 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 Article


DrawRay 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 Article

Call 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 Article

DrawRay 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 Article

How 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 Article


Debug 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 Article

RayCast2D 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 Article


Rotation 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 Article

Raycast 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 Article


Draw 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 Article

Rays 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 Article

Raycast 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 Article
Browsing all 92 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>