How would you set the raycast to go from the camera to the humanoid/character

How would you set the raycast to start from the camera and go to humanoid/character while making sure it moves with the camera?

You could track the camera’s velocity and see if it’s moving, but alternatively (reccomended) and suggested is that you track the last position of the camera (camera.CFrame). Then If the current position does not equal that stored position assume the camera has moved or is moving, constantly update that variable. and there you go. Raycast normally from the camera to the character.

I hope this helps

1 Like