Does someone know the math behind this

Does someone know the math behind this system? its a pretty old game but their effects still looking cool

I mean, i have have an idea of how do to it based on lookVector and maybe bodyposition? i dont really know, if someone can explain me…

Sorry if my english is kinda bad its not my first language, Im not asking for the entire script, just how to figure out the direction, if someone want to test it in game ill leave the game link here:

Test game

All you need to do is just stick on the wall and press R

Keycodes, BodyPosition, code (obviously), animations, meshparts (VFX) and other stuff.

And what game is that?? Would love to try that

1 Like

I know about the logic and i got the idea of how to make it, im just trying to understand the math behind of how im supposed to get the right direction to dash the player to, i sent the game link on the original message, ill send it again:

Game

Do note this is a complete guess, and I have no idea how they did it, nor if my idea would even work (untested). however they could maybe have found the closest point (click for link), then sent the player in the opposite direction by turning the

local direction = (HumanoidRootPart.Position - closestPointPosition ) 
-- ^^^ may need to be switched, always get this mixed up.
HumanoidRootPart.AssemblyLinearVelocity = -direction 

(wont respect geometry though).
You can also accomplish the same thing just by sending a raycast in the direction of the lookvector, then using the raycastresult.Normal to create the direction to send them in. (will respect geometry)