Quantcast
Channel: Questions in topic: "drawray"
Browsing latest articles
Browse All 92 View Live
↧

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


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


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

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

LayerMask, 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 Article


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

DrawRay 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

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


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

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

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


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

2D 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 Article

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

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



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 Article
Browsing latest articles
Browse All 92 View Live


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