GetReachLineEnd and PlayerViewPointLoaction

So during the refactor I did this.

Set the following private variables
Section3-83a

And was able to use one function

I just used PlayerViewPointLocation to replace GetReachLineStart. I am changing it to match the lesson I was just curious if anyone can point out any issues with doing it this way. I assume it may have to do with doing 2 things with a function but any other feedback or explanations as well is greatly appreciated.

PlayerViewPointLocation in this case is only updated when GetReachedLineEnd is called, and that only gets called when you are grabbing something or in the GetFirstPhysicsBodyIsReached itself.

So the PlayerViewPointLocation may not actually be actual current player location.

I like the direction you are going - I was really dissatisfied in the video that the refactor left in that we are running GetPlayerViewpoint multiple times in some cases (and the copy/paste that is going on).

I added an UpdatePlayerViewPoint method which saves the location and rotation into private variables on the class. I call this from the Grab function and also in the tick. Then I use the private variables in the functions where they are needed.

Privacy & Terms