I am making a beam move in my game and I plan on using getpartsboundinbox to register the hits and act as a hitbox.
I also wanna make sure this beam cannot go through walls. I will use raycasting for this. But this also means the beam is going to vary in size when a player shoots at a wall. How can I get the raycast position and the position from the start of the beam to adjust the size of the hitbox?
To get the length between 2 positions you do (Position1 - Position2).Magnitude & that returns the length between
2 Likes
How can I get a CFrame thats in the center between these two positions and will always point in the right direction?