GorzenDev Posted January 30, 2018 Share Posted January 30, 2018 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? Quote Link to comment Share on other sites More sharing options...
GorzenDev Posted January 31, 2018 Author Share Posted January 31, 2018 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? Quote Link to comment Share on other sites More sharing options...
GorzenDev Posted January 31, 2018 Author Share Posted January 31, 2018 I found the culprit. It whas actually the hitbox created in the start function of the FPSPlayer script which i overlooked. In my defense this hitbox whas never part of the FPSScript last time i used it. 1 Quote 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.