Jump to content

[SOLVED]World:Pick problem against model with multiple surfaces.


GorzenDev
 Share

Recommended Posts

I am working on a third person controller with 'over the shoulder view', all thats left to do is camera collision/occlusion.
I do a world:pick from the camera's lookat target back to the camera, then check distance etc.
But the problem is my pick hits the character, or so it says.
I know this sounds like a noob problem and it may as well be for all i know.

I set pickmode and collisiontype in the modelscript.

	self.entity:SetPickMode(0, true)
	self.entity:SetCollisionType(Collision.None, true)

During picking i print some stuff.

	local distance = -1.0
	local pickInfo = PickInfo()
	if world:Pick(p0, p1, pickInfo, 0, true) then 
		System:Print("camera occluded by: "..pickInfo.entity:GetClassName())
		System:Print("name: "..pickInfo.entity:GetKeyValue("name"))
		System:Print("collisiontype: "..pickInfo.entity:GetCollisionType())
		distance = p0:DistanceToPoint(pickInfo.position)
	end

The weird thing is the print results.

Quote

camera occluded by: Model
name: 
collisiontype: 1

I checked and collisiontype 1 = Collision:Prop.


How is it possible my model has collisiontype 1 ?
Could it be because my model has multiple surfaces ?

Anybody has an idea?

Link to comment
Share on other sites

I have combined all my model surfaces into 1 surface and pick still returns prop collision.
I have checked every single entity in my scene and made sure none have a Collision:Prop.
I even went all the way and attached a script with pickmode(0) to every single brush and even all the skeleton bones.
It still returns the same result.

This is an impossible situation there is no way pick should return collision on something with collisiontype prop since there simple is nothing having that collision type in my scene.
 

"Frustration starts to build"

Nobody had similar problems and have an idea what could be wrong?

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...