Jump to content
Arska134

Entity pick not accurate

Recommended Posts

Sometimes this code won't pick entity even though it's certainly picked.

If GetEntityKey(mpick.entity, "player") then
'do stuff
endif

Share this post


Link to post

What exactly are you trying to pick ??? I can remember that you can't pick the terrian mesh direct or models ,where you have to get the mesh of the body first ( A model is a body, which has a mesh as child, so you have to get the child and read your key from that )

Share this post


Link to post

I am trying to pick other players. When player joins game i do this:

SetEntityKey( pp.model, "player", pp.nickname)

 

pp.model is:

pp.model = loadmesh("abstract::swat.gmf")

 

So pp.model is mesh and it should be picked?

Share this post


Link to post

Is it better to do some kind of "hitboxes" on players to register hits, or is this good way to go? Currently it's not really good because it's not working. :(

Share this post


Link to post

Have you set the entity type of the mesh and have you set the collisions so that the raycast type and mesh type result in a registered collision?

 

Also if the character is animated the pick will only work on the original mesh of the character and not the resultant skinning deformation you see.

Share this post


Link to post

It is much better to check hit against some primitives not player mesh . Best practice use capsule . If you want to have check hits against all body parts then you have to make something like ragdoll and bounding box .First make check is there hit on bounding box.Only in the case if there is , then you can check which part of body.

 

One capsule is OK , make it simple.

Share this post


Link to post

It is much better to check hit against some primitives not player mesh . Best practice use capsule . If you want to have check hits against all body parts then you have to make something like ragdoll and bounding box .First make check is there hit on bounding box.Only in the case if there is , then you can check which part of body.

 

One capsule is OK , make it simple.

 

 

Entity Picks only work on mesh / surfaces. How are you going to have a capsule mesh that isn't obscuring the model..... If you hide it the pick won't work.

 

I think you've confused this with body collisions.

Share this post


Link to post

I guess you are alone with this cause its all about how you lay out the structure ...

 

object_phyBox.png

 

thats loosely implemented (like all releated to weapons) - however, i just load the mesh of a character and a controller which are not parent or child of the model but the loaded phy object is a child of the model and can be picked ... if that pick occurs i wander up and down the parent/child relations to send a hit message to the model (ENTITY_MODEL) which handles the animations etc. for the character mesh.

 

You most likely want to bind collision spheres to "bone" joints and work with pick.filter

(handling every pick like i do is pretty bad).

At the end i will track every character entity because i dont need to know that a pick occurred but which and where a character got hit by raytracing.

 

hth

Share this post


Link to post

Entity Picks only work on mesh / surfaces. How are you going to have a capsule mesh that isn't obscuring the model..... If you hide it the pick won't work.

 

I think you've confused this with body collisions.

 

Hmm, I have to think about that , but anyway , raycast with mesh that has 3000 or more polygons is not a good idea, especially when you have a lot of enemies in level. I don't know how LE handles that inside, but I am sure that has to be some work around , perhaps (show and hide capsule or something... ) I have to refresh my mind first smile.png . I have to go now , but I will look at this problem when I come back.

Share this post


Link to post

What I did (in the past) with this is to show the mesh before picking, then hide it right after and it'll never be seen but do it's job. It doesn't take a whole iteration for the show to take hold or anything.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...