Yue Posted November 12, 2019 Posted November 12, 2019 I have a beam that comes out from the player and positions the camera when at the collision point of that beam. Everything works fine, if you use brushes and terrain inside the editor, but if I carry a mesh, it doesn't seem to work properly. function this:RayCamera() self.pickInfo = PickInfo() self.ray = self.world:Pick(self.pivotPlayer:GetPosition(true) ,self.pivotCamera:GetPosition(true), self.pickInfo, 0, false, Collision.Debris) self.cameraPlayer:SetPosition(self.pivotCamera:GetPosition(true)) self.cameraPlayer:Point(self.pivotPlayer) if self.ray then self.cameraPlayer:SetPosition(self.pickInfo.position + (self.pickInfo.normal/12),false) self.cameraPlayer:Point(self.pivotPlayer) else --self:MoveToPoint(self.cameraPlayer,self.pivotCamera:GetPosition(true),0.1) end end Ray problem mesh.mp4 Quote
Solution Yue Posted November 12, 2019 Author Solution Posted November 12, 2019 Ok, solved here. Sorry. self.ray = self.world:Pick(self.pivotPlayer:GetPosition(true) ,self.pivotCamera:GetPosition(true), self.pickInfo, 0, true,Collision.Debris) Quote
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.