tipforeveryone Posted June 28, 2018 Share Posted June 28, 2018 I am trying to build a Top view shooting game First I use Camera:Pick to get collided position by Mouse pointer to Terrain, everything ok, System:Print() can make output of collided position --set shooting point follow mouse cursor mousepos = window:GetMousePosition() mousePickInfo = PickInfo() if camera:Pick(mousepos.x,mousepos.y,mousePickInfo,0,true,Collision.LineOfSight) then shootingPoint:SetPosition(mousePickInfo.position) --shootingPoint is a pivot which I created in Script:Start() System:Print(mousePickInfo.position) end Then I create a ray from player position to mousePickInfo.position then there is problem, the ray can not collide some areas of terrain and return 0,0,0 position, a height map was imported to construct terrain bulletPickInfo = PickInfo() world:Pick( body:GetPosition(true), mousePickInfo.position, bulletPickInfo,0.2,true,Collision.LineOfSight ) I use a context:DrawLine to visualize the ray, and here the video, notice that when I move the mouse, sometime the red line changes its end point Link to comment Share on other sites More sharing options...
macklebee Posted June 28, 2018 Share Posted June 28, 2018 Not enough info to tell but I suspect this is not a bug. More than likely its an issue with mixing local, global, and/or screenspace positions. Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Josh Posted February 28, 2019 Share Posted February 28, 2019 I need an example in order to test this. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tipforeveryone Posted March 1, 2019 Author Share Posted March 1, 2019 This project of mine was erased, but I will recreate it for you to test, don't close this topic yet Link to comment Share on other sites More sharing options...
Recommended Posts