Why would you choose raycasting rather than 3d?

Godot Version

4.5.1

Question

Why would you choose raycasting over 3d? What are raycasting benefits, and 3D benefits?

I recently used raycasting in Microsoft makecode arcade but I only did because it was the only option. I never saw any benifits in raycating

Thanks in advance

func _ready() -> void:
    print("hello world")

Is raycasting not 3D?

6 Likes

You can raycast in as many dimensions as you care to :stuck_out_tongue_winking_eye:

Of course, that doesn’t change the fact that the question asked here is nonsensical.

5 Likes

You wouldn’t, because they are not opposites.

In 2D or 3D?

It’s not 2D for one. This is too broad a question to answer.

A quick Google search shows me that the most often reference to “raycasting” for Microsoft Google Arcade is the use of ray casting to make a 2.5D game. Hence your confusion in your initial post. The benefits of using the ray casting technique in Microsoft Google Arcade is to simulate 3D in a 2D environment like really old shooters like Wolfenstein 3D. They are called 2.5D games.

The only benefit to a 2.5D game is aesthetics - and it’s more complicated than doing a pure 2D or pure 3D game in Godot.

Raycasting is a technique for shooting a “ray” along a vector in 2D or 3D space. It is used for collision detection in both types of games.

So, the answer to your question is you should use 3D.

4 Likes