Jump to content

camera:Pick issue when specifying pick type


tjheldna
 Share

Recommended Posts

Pretty sure its a bug. It appears when using Pick in the context below specifying a type. I want to just Pick "Prop" types.

 

local pickInfo = PickInfo()

self.mouseCursor = self.mousePointer
if self.camera:Pick(mpos.x, mpos.y, pickInfo, .1, true, Collision.Prop) == true then
if pickInfo.entity ~= nil then
if pickInfo.entity.script ~= nil then
local name = pickInfo.entity:GetKeyValue("name")
end
end
end
end

 

I've tested with Collision.Prop and Collision.Character and the pick returns true when hit an entity set to "Scene" which I'm sure isn't right. The only time it appears not to pick the entity is if I set the entities collision type to "None".

 

Cheers!

trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0
Link to comment
Share on other sites

If you take a look here http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778

you can see that Collision.Character and Collision.Prop collide with Scene.

 

You will have to do a check to see if what you hit is a Collison.Prop.

 

Or another way I have done before is SetKeyValue of the items you want to hit and check the name using GetKeyValue.

Elite Cobra Squad

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...