Need help with calculating direction

Hi! I’m trying to raycast from a part to the camera’s position, but I can’t seem to find the right way of calculating direction.

my code:

 workspace:Raycast(raycastParams, player.Position, player.Position - camera.CFrame.Position).Unit

please don’t tell me that player doesn’t have a position property, I know what I’m doing :smiley:

I’m assuming ‘player’ is the part. If you’re trying to raycast from the part to the camera then why are you doing ‘player.Position - camera.CFrame.Position’ for the end location. The direction of the raycast is always from pos1 → pos2. I’m also pretty sure the parameters for the Raycasting function should be ordered pos1, pos2, raycastParams.

Yes, the parameters are ordered incorrectly but that’s not my issue. I just don’t know how to get the direction to raycast in.

Neverming. Got it working. Thanks for your help!