Jump to content
  • 0
๐Ÿ’ŽYue๐Ÿ’Ž

Help with the rays!

Question

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

ย 

ย 

ย 

ย 

Share this post


Link to post

1 answer to this question

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.

Guest
Answer this question...

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

ร—
ร—
  • Create New...