0 votes

Hello I'm trying to raycast from the position of the mouse to something in the game world but it's not working. My code:

ray.set_enabled(true)
var camera = get_node("Target/MainCamera")
var from = camera.project_ray_origin(mousePos)
var to = camera.project_ray_normal(mousePos)


 ray.cast_to = to
 ray.translation = from

 if ray.is_colliding() :
 print("found")
asked Jul 15 in Projects by Qushy (28 points)

I'm not entirely sure but don't you set the day length too short this way?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.