Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | DKesserich | |
Old Version | Published before Godot 3 was released. |
Is there a way in 3D to make a collider that exists inside a different collider still be clickable when the camera is outside the larger collider?
For example:
If I have a 1 meter cube with a box collider that’s the same size, but it’s inside a 10 meter sphere that has a 10 meter box collider, and I want it so when I double-click on the sphere the visibility of the cube changes, and when the cube is visible and I click directly on it the cube registers the click event instead of the sphere.
Do I have to do this all with raycasts, or is there an easier way?
I was able to figure out getting the collision with a raycast. My trouble now is figuring out how to send an input event to the object that is returned by the raycast.
I’ve tried
find_node(collisions["collider"].get_name())._input_event(event stuff here)
and I get a “Nonexistent function '_input_event' in base Area
” error. Is _input_event
a private function or something? The documentation for CollisionObject doesn’t say anything about that. What am I doing wrong?
DKesserich | 2017-12-15 23:42