I’m oblivious to how this is supposed to work when using rays. Some people say use ‘CFrame.new(Position1, Position2).p’ and that somewhat works, but it would also make the projectile shoot in random directions whenever something is in the way of where you’re aiming.
Any help or information (or even advice) on this issue I’m having is definitely appreciated.
I’m not exactly sure what you’re trying to do here, I might be able to help you further if you could tell me a bit more on what you’re trying to make here.
But with that, raycasting basically casts a ray at an origin position, at a given direction, with a specified length. It doesn’t draw a ray that physically keeps going like a bullet, it’s basically a ray in geometry. It expands infinitely in a given direction from the origin point. (but like I said you can specify the length of the ray here.)
This issue has also been really hard for me to explain so sorry if I’m not giving enough detail.
Basically what I mean is that I want to use a ray for a bodyvelocity (because people tell me to use rays whenever I ask how it’s done), but I just don’t understand how to do it the right way. When I first tried (I know this is not too smart) I used ‘BodyVelocity.Velocity = Ray.new()’ which didn’t work for me as it gave an error.
EDIT: It doesn’t even have to be a physical part, this formula should remain the same. You put in two points and it’ll get the direction from that, and you can then multiply it by the speed.