How can I calculate the end position of a raycast based on the direction of a rotated part?

Hey everyone,

1:
I’m working on a raycast feature and need a bit of help. I basically need a starting and ending point. I’ve got the starting point figured out—it’s just the position of a part.
part.Position
But for the ending point, I’m adding some distance above the part using Vector3.new(0,50,0).
part.Position + Vector3.new(0,50,0)

2:
The trouble is, when the part rotates, the ending point stays put above it. I want it to move with the part’s direction instead. Any ideas on how to make this work? I’ve included a picture to show what I mean.

Thanks for any help you can offer!

nvm found it myself :sweat_smile:

part.CFrame * Vector3.new(0,50,0)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.