Creating a 3d game using ray casting and an artificial z axis

Using trails this could work, but I’m not sure how. I know i can use ray casting as an fog and measure the depth based on the distance of the ray from the player, but again, not sure how.

10 Likes

I also know I can use a hitbox the create the collision.

7 Likes

Now that I think about it, you don’t need an artificial z axis

6 Likes

Raycasting is something that is interesting but indeed, a bit tricky to get working. Since you mentioned raycasting, you probably already know about it, but personally, I’d use clones for each direction that bump objects, and when a clone bumps the player object, you can detect how far it is from the starting position and determine the distance using that.

It’s a theoretical idea since I haven’t done raycasting before. Hopefully, someone with more experience on the subject can fill in the details!

And, some questions that you could answer to help others understand your problem more in-depth:

  • Have you made any code for this project yet?
  • What kind of object is the ray going to go to?
  • Which directions do you need rays in (do you only need 4 directions or more)?
9 Likes

I have some code, but it haven’t been working.
The ray will just cast on a rectangle
All rays will be in a row with an fov of 45

5 Likes

It would render the depth and make it 3d with a set of trails.

5 Likes

@CreationsOfaNoob I believe you have used this concept in your “3d maze” project

8 Likes

Yes I have, if I understand you correctly.

6 Likes