Skip to main content

Questions tagged [raycasting]

A technique for using rays to determine points of intersection. Often used in lighting simulation.

Filter by
Sorted by
Tagged with
0 votes
0 answers
90 views

I'm developing an FPS shooter in Unreal Engine 5 and currently working on the aiming mechanics for keyboard and mouse (KBM). I want to implement an aim assist system that uses ray casting to detect ...
Eric Wright's user avatar
0 votes
2 answers
165 views

I have written a simple raycaster in C++ which can render wall based scenes like 3d mazes. On YouTube I saw a video showcasing 3D games made in Scratch. One of the games were a 3d racing game where ...
Nabir14's user avatar
  • 59
0 votes
0 answers
61 views

I am making a Sonic game in Pygame and I have recently gotten my hands on a Python class that uses pygame.rect and pygame.mask in unison to create sensors that can be used to accurately detect the ...
miggle's user avatar
  • 1
0 votes
0 answers
96 views

I come for theory help with a classic raycast algorithm (currently, based on DDA). The problem is not with the algorithm itself, but with the floor rendering code. I left the code of my raycast render ...
Jay's user avatar
  • 1
1 vote
1 answer
126 views

I'm trying to ray-cast mouse clicks to the surface of a sphere (from which point, I'm going to get the coordinates of the vertex of the sphere's mesh that are closest to the click). The following ...
Jax's user avatar
  • 474
0 votes
1 answer
104 views

I am making a snake AI with Unity ML Agents. There will be lots of snakes who will eat and dodge each other. A 3D RayPerceptionSensor detects everything, but there is a specific case where a problem ...
Ujjawal Saini's user avatar
0 votes
1 answer
177 views

I've been trying to fix this problem myself for ages, but I really do need help. I'm creating a BSP tree for my 3D game (baked in the map files, quake style) to replace my existing naïve collision &...
Elgen T's user avatar
0 votes
1 answer
350 views

I've run into a curious issue when implementing ray picking in my game engine. It seems the Z coordinate of the Projected matrix has to be ever so slightly more than ...
Josh McCord's user avatar
0 votes
1 answer
110 views

I have a gameobject with a mesh collider. The mesh is simply a flat plane. I raycast to the mesh and I'd like to get the index on the material's basemap where I got a hit. I assumed ...
user1999728's user avatar
0 votes
0 answers
131 views

I'm out of ideas at this point. I'm trying to set up a function inside my player controller that aligns the player with whatever is under it (usually the ground), ive tried using Raycasts, collisions ...
Pow's user avatar
  • 449
0 votes
0 answers
47 views

I am writing a simple graphics engine using Rusts WGPU. I have a Sphere rendering at the origin of my scene like so: ...
shaneB's user avatar
  • 1
0 votes
0 answers
100 views

I have a question regarding Unity VR and Interaction Toolkit. When I point at a UI canvas element, the raycast turns from red to white (indicating that it is a valid target). However, when I create a ...
 d_test_2030's user avatar
1 vote
1 answer
97 views

I've tried to ray cast my mouse position to Sprite3D on screen but I have some problems with it. ...
Pucka's user avatar
  • 13
0 votes
2 answers
154 views

What if an object were to have collision detection implemented as so: A ray in the direction the object is moving in, and a ray in the direction of gravity.
Nato's user avatar
  • 9
0 votes
0 answers
52 views

I'm making a VR game in Unity. I want to select a cylinder with ray interactor and drag it, and as I drag, it should stretch. This is the code I have currently for 2D: ...
SPP's user avatar
  • 1
1 vote
0 answers
80 views

I'm trying to implement a function that takes a ray as its start and end position and returns all intersections with the map grid. I wrote following code and got a problem. Function returns correct ...
CalmlyGrass's user avatar
1 vote
0 answers
204 views

I am writing a pseudo-3D game in Python. After I tried to fix the fisheye problem, a new one appeared - if you stand close to the wall and look so that the wall is on the side, then the borders of the ...
kingley's user avatar
  • 11
1 vote
1 answer
364 views

I'm trying to cast a ray so I can implement mouse picking. My game uses 2:1 isometric with a 3D world sim that uses AABBs. Positive X points to the bottom right, positive Y points to the bottom left, ...
Archduke's user avatar
0 votes
1 answer
71 views

Before this, I try to insert an image in a tooltip and it was already done. But right now, I want to try to insert a sound in the tooltip. What I want to do is when I point my cursor to the object it ...
Hidayah__0111's user avatar
0 votes
2 answers
128 views

I want to display the image using a tooltip. So when I point to the 3dobject, it will display the image that I already created. Right now I already set the sprite in the tooltip but I have an error in ...
Hidayah__0111's user avatar
0 votes
1 answer
240 views

I'm making a 2D game and I'm using a raycast. I want the raycast to ignore the platform when hitting it from beneath, but not when hitting it from above. Right now the raycast always hits no matter ...
Andre Alvarez's user avatar
0 votes
1 answer
502 views

I'm rendering a maze with raycasting in Scratch. When I'm far away, the walls look nice, but when I'm near the walls they get a weird fisheye effect: Here is the code for the raycasting: And the code ...
Scratcher's user avatar
0 votes
1 answer
756 views

I have about ten UIs with buttons in my scene. I can cast my XR Ray on all of these UIs and the buttons work fine except two. The buttons on these two UIs are clickable but the rays are not showing on ...
Craving_gold's user avatar
0 votes
0 answers
121 views

I have a 2D Sprite that patrols around a platform and is supposed to flip when it reaches the edge. The way the flipping is implemented is through Raycasts. There are two Transforms, on the Left and ...
Sternutation's user avatar
0 votes
1 answer
303 views

I have a simple scene in my Unity 3d project. There is a Canvas (UI Scale Mode in Canvas Scaler is set to Constant Pixel Size but the same is with Scale with screen size), Panel inside it (Stretched ...
crackanddie's user avatar
0 votes
1 answer
140 views

I am making a 2D platform and implementing a character similar to a Mario Goomba. This character will move left or right, depending on whether or not a raycast determines that there is an object in ...
TBG's user avatar
  • 25
0 votes
1 answer
1k views

I am setting up my project with XR Interaction toolkit. As usual, there are two red rays from the controllers after the set up as shown below. However, I want the rays to appear exactly as it is in ...
Craving_gold's user avatar
0 votes
1 answer
431 views

I'm making a simple character controller. Each frame the player moves by moveDistance units in the moveDir direction. I'm ...
EEAH's user avatar
  • 113
1 vote
3 answers
2k views

Inigo Quilez's website has a page of 3D ray-surface intersectors, one of which is for a basic 3D box: ...
Nairou's user avatar
  • 634
0 votes
1 answer
711 views

I have a grid of gameobjects with colliders. Currently they all have unity's inbuilt void OnMouseDown function which gets called when the mouse clicks on a collider. This then executes some game logic ...
iamconfusion's user avatar
2 votes
1 answer
370 views

I'm trying to build a simple grid-based raycaster, but I'm having trouble with rendering block corners. First of all, I want to change the color of all the y-axis walls. But a block's corner belongs ...
user avatar
1 vote
0 answers
440 views

I'm writing a raycasting engine in C++ and SFML. I have the wall texturing done and I'm trying to get floor and ceiling texturing right. I almost got it but the textures are "sliding" when ...
Xscreade's user avatar
0 votes
1 answer
273 views

I have an issue with my character controller. I'm using a raycast from the enemy AI as a line of sight in order to start following the player. My issue is that with my current character controller ...
stratos la's user avatar
0 votes
1 answer
103 views

Context Hello, its me again. I have been playing around with "Object Pool" and it is fascinating the amount of CPU performance can save up. However, I have encountered a new "feature&...
Zeid Tisnes's user avatar
0 votes
1 answer
431 views

I am having a problem where my ray is unable to detect the player, even if I did layermask and went to draw ray and all other stuff. Here is my code ...
Ujjawal Saini's user avatar
0 votes
0 answers
62 views

I have a bicycle with suspension and need to find the contact point of the wheel on the "road". If the front fork was pointing straight down, it would be as easy as doing a raycast down the ...
Charl Cillie's user avatar
0 votes
1 answer
2k views

I've been searching through the Unity docs (https://docs.unity3d.com/ScriptReference/Physics.Raycast.html), but no matter where I look, I couldn't find exact behaviour of Physics.Raycast() method. I'...
tomek320's user avatar
0 votes
2 answers
118 views

I have a ship that will shoot targets, but cannons on the right side should never try to shot at targets on the left side of the ship. Thus I have created sectors using the ...
Mad Hatter's user avatar
1 vote
1 answer
518 views

I am trying to create a raycasting engine using C and CSFML, I already have the walls and textures rendering done and right now I would like to be able to render sprites into the scene. The difficulty ...
Xscreade's user avatar
0 votes
0 answers
762 views

I've been having this problem in the last couple of hours and I was just thinking if someone could help me figure it out, since I am unfortunately not a programmer, or at least a good one at all. I'm ...
mikeadam's user avatar
1 vote
2 answers
1k views

I've tried Bresenham line and Raycasting, but they don't quite give the results I need (examples in the screenshot). '&' - character '+' - cells that can be attacked by the character '#' - walls ...
Clyeh's user avatar
  • 13
0 votes
0 answers
336 views

I have been trying to work on raycast, where if a raycast hits an object then an image will be displayed on the canvas, like on COD Warzone if I go to an elevator shaft, and look at the wire to go up, ...
Artificial Engineer's user avatar
1 vote
0 answers
588 views

I'm trying to determine if a point is inside or outside a (triangle) mesh. The best way I found was to cast a ray from the point and count how many triangles intersect. (Odd or even). I used Möller–...
Dolfje's user avatar
  • 11
1 vote
0 answers
78 views

I'm currently working on a raycaster in Java, and so far, I have the floor correctly textured. The problem, however, is that the floor doesn't scroll. In other words, when I move the camera in the ...
Joshua Crotts's user avatar
0 votes
1 answer
5k views

INTRODUCTION: In unity, I want to make a dynamic, object use system. Where the main player camera shoots a raycast when left mouse button is clicked and if an object that can be used for example a ...
Object's user avatar
  • 289
0 votes
0 answers
93 views

I have a 3D side scroller style game in which the player flies along avoiding stuff, you know, side-scrollery things. I'd like to add an effect (particle system) to the player when they get close (say ...
Twisted's user avatar
1 vote
1 answer
138 views

I found a video on YouTube with a sercol and a beam, and everything seems to be fine, but the beam doubles and flickers after spawning from the mirror, tell me what could be the problem, screenshot ...
Андрей Тарасков's user avatar
1 vote
1 answer
986 views

I'm using code like the following with a tilemap and tilemap collider 2d: var ray = Physics2D.RaycastAll(worldCoordinate, Vector2.zero); Unfortunately, when I ...
Alexander Trauzzi's user avatar
1 vote
1 answer
151 views

I want to determine if a mesh is lit by the directional light on my scene in editor to automatically disable its "dynamic shadow casting" property (let's say I have one light source in my ...
Netherwire's user avatar
0 votes
1 answer
2k views

I'm building a Raycast setup where game objects run code on click / touch. ...
Matthew's user avatar
  • 101

1
2 3 4 5
10