Jump to content

Pick questions


YouGroove
 Share

Recommended Posts

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 ?

Stop toying and make games

Link to comment
Share on other sites

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.

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

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.

Stop toying and make games

Link to comment
Share on other sites

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.

Stop toying and make games

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...