Hey there, I dont wanna get an argument with either of you, but my original solution with the code i posted is the most optimized, as it uses simple vectors and not multiplying cframes.
Well just because it’s more simple doesnt mean its exactly more well optimized
Oh also this actually worked too thank you, problem was it just went through walls but its also good thanks!
Yeah your solution is the correct solution, it’s exactly what I stated with the raycasting. Only thing though is, to preserve rotation you could use CFrame
instead of Position
if required. Though, you can optimize it a little since you’re doing it on a local script like switching the RenderStepped to only when the player moves which you can detect easily on the client.
I won’t continue this further but it was just my suggestions.
I’m sorry If I came off in a way that was rude, your solution was correct it just wasn’t exactly what I was looking for, thank you for writing up that script and your time.