YouGroove Posted February 15, 2014 Share Posted February 15, 2014 I have this code below , and it don't collides with other character controllers only other physic models or level stuff. It is normal ? if App.world:Pick(pos, dir, p ) == true then if p.entity ~= nil then self:sphere2(p.entity:GetPosition()) local type = p.entity:GetKeyValue("type", "") if type == "alien" then p.entity.script:White() end end end For debugging , i created a sphere at entity position that has been Picked and yes only level and solid physic stuff is detected. Should we always use some Camera:Pick(x,y,entity) instead ? Should not World:Pick(vector3,vector3,enity) work with character controllers ? Quote Stop toying and make games Link to comment Share on other sites More sharing options...
f13rce Posted February 15, 2014 Share Posted February 15, 2014 Have you made sure every entity you're trying to pick has a shape? Basic models like a box and sphere already have a shape. Imported models don't have a shape by default. Quote Using Leadwerks Professional Edition (Beta), mainly using C++. Windows 10 / Linux Mint, Visual Studio 2017. GPU: NVidia GeForce GTX970, CPU: Intel i7 7700K @ 4.20 GHz Previously known as Evayr. Link to comment Share on other sites More sharing options...
YouGroove Posted February 15, 2014 Author Share Posted February 15, 2014 Ok, i found the problem. That's not physic shape that is detected on Pick() , but visible triangles of your model. My Raycast didn't touch the model polygons, even if physic cylinder was lot more highter in Y. So i just scaled in Y the visible 3D model and yes Picking worked. Another test : i supressed Physics from a bigger model and rayscat still detected the model. Pick will work with visible rendered models not with physic geometry. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rick Posted February 15, 2014 Share Posted February 15, 2014 See I knew before that picking is on the geometry and not the physics shape! Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 15, 2014 Author Share Posted February 15, 2014 Why Leadwerks 3.2 demo FPS uses several hidden box collision on zombie bones as child to detect collision ? Pick() works on animated i think, so just detecting if pick hits' entity would have been enought no ? Box are good to detect what part of a model is hit like leg or torso, but for general collision pick() is enought and ok. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.