Hey developers,
I’m trying to figure out how to solve a position or cframe for my axe’s trajectory using bézier curves with 3 points, 2 of them I currently have is the Axe & Goal position. (Axe is the start position, while the goal is the end position)
The point I’m missing is a position over an obstacle, which is the middle point for my bézier curve.
I couldn’t find a solution besides trying to cast a few rays which could be expensive if the part is large.
I’m trying to figure out which side the axe should go over to return to it’s user, raycasts might solve this because of the position and normal, but will be hard to calculate which side is the shortest/smallest
I think this solution is dumb but this is what I can think of, (Apologies for bad writing)
one raycast will get the obstacle, while the other raycasts is to check the sides of the obstacle,
if the raycast doesn’t hit anything then it would be considered as “air” which is a positive,
otherwise will repeat the process of casting a few rays but different positions over the obstacle to check for any parts beside it
once i get any results, i will use the raycast’s normal and position with a little offset relatively to it’s obstacle
I think your doing a bit too complicated I THINK you can just get the difference in position and the direction using Magnitude and Unit and see whether the player is in the right or left side so basically use CFrames you can check using ToObjectSpace() and if the angle is below zero means he is on the right side (or the opposite so check it yourself)
and again this could be COMPLETELY wrong as i have never done this type of scripting