I quite new in Defold, im alredy read many of topic and try read API but still i dont know how make 3d object clickabled. I mean for now i understand i must convert mouse position from world to screen -:
posi = rendercam.screen_to_world_2d(action.screen_x, action.screen_y)
but i dont know which one transformation use for object. or how do it properly bcoz i try many way but at all no one work.
For learning i use https://github.com/rgrams/rendercam
elseif action_id == hash("right click") then
posi = rendercam.screen_to_world_2d(action.screen_x, action.screen_y)
if rendercam.world_to_screen(go.get_world_position(go.get_id("model"))) == posi then
go.delete(go.get_id("model"))
end
of course i add “rightclick” and also " left click" in game input binding, and i check do it works ( i mean i try just something like that :
elseif action_id == hash("left click") then
go.delete(go.get_id("model"))
and that work but i dont know how make reaction when cursor will by on object and click object / model ?