Yue Posted November 12, 2019 Share 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 Link to comment Share on other sites More sharing options...
Solution Yue Posted November 12, 2019 Author Solution Share 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 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.