Help finding end point of ray part

  1. What do you want to achieve?

Hello! So basically, I created a simple raycasting script, and I want to make an explosion wherever the end part of the ray is.

  1. What is the issue?

I cannot figure out how to create the explosion at the end of the ray.

  1. What solutions have you tried so far?

I have tried this line of code that I found on the forum;

local Pos = (aBeam.CFrame * CFrame.new(0,aBeam.CFrame.Y,0))

However, it doesn’t work, as when placing the explosion part at this position, it places it in the middle of the beam.
Also, please be nice :slight_smile:

3 Likes

To find the end point of a ray, I believe you can do this:
ray.Origin + ray.Direction.magnitude * ray.Direction.Unit

Try this out and let me know what the result is!

8 Likes

thanks!
(30 characters)ssssssss

1 Like