|Topic was automatically imported from the old Question2Answer platform.
I have many different 3d-meshes imported in scenes from blender.
Now I want to get the respective mesh object from a 2d viewport coordinate of my camera.
What is the best way to handle this?
I read this can be done by adding collision shapes to my meshes and using their input events. But for this I would need to create a new scene for each of my exported scenes, since they are not editable and add a collision shape there, afterwards replacing every loaded scene in my game by the inherited one. Doesn’t seem like a clean solution to me.
I know there is another method using a raycast from my camera, but I don’t know how to check the collision with a mesh then.
Thanks for your help,
I can’t get why you aren’t generating collider based on given mesh. No need to create different scene for each mesh. You could attach project demo, maybe I don’t understand your problem and that will help me solve it.
Oen44 | 2018-09-18 11:29
Thanks for your comment, I try my best to explain it a little better. I’m not sure yet how a demo project explaining my issue could look like, I think it may be easier if I describe it this way:
I used blender to create a few 3D buildings, which I exported using the better-collada-exporter. I have a folder with all my materials and one .dae file for each building.
Imported in Godot each .dae file is one scene, which is not editable. Inside the scene is one node with one MeshInstance node. I can’t create a collision shape in that scene without creating a new inherited scene. That’s what I mean by “creating a new scene for each object”.
From my camera’s view I want to know which building is at a given screen position.
I managed to implement some other things without creating an inherited scene from each of my exported .dae’s, so I am looking for a solution that gets this task done without creating new inherited scenes either.
TobiLa | 2018-09-18 12:26