How to get direction from a collision for a skateboard?

I am making a custom skateboard but I want it to make it so any direction the skateboard is going when it collides, it will send the player and the skateboard to the direction it was moving to just like a skateboard or bike accident where it flings the player and skateboard for a really short amount of time.

I want to know where the skateboard was going from. For example, if the player drives a skateboard from the middle of the road to the sidewalk from the left, the player and the skateboard will collide from the left because of the speed and the direction the skateboard was going from. (I am only able to just ragdoll the player)
image

Problem video: https://gyazo.com/2d590a5820de8a16eb54198e4db55e31

you could try using the LookVector of the part? or maybe put multiple detectors, and then decide the direction to throw the player based off of which detector is hit

Lookvector can be an answer but I don’t know how to get the LookVector based on the direction the skateboard was going to. (Detecting if the skateboard was going to the left or right before it hits the platform.

Hey, I need answers please guys.

LookVector is defined as the front face of a part. My other suggestion was to put sensor parts around the border of the skateboard and if the sensor on the front left is hit, fling forward left etc. Using look vector could mean only flinging the player straight ahead. I think you can use Part.LookVector maybe.

Yeah but I think there are other better ways to do it.

hey guys, mind if you can help me?

I am not sure how. I would refer to @ramdom_player201 comment.

To get a directional vector you would take the origin point and subtract it by the target point and use .Unit, example:

local Direction = (OriginPoint - TargetPoint).Unit

If you wanted to get the a little forward and to the left of your character you would use the LookVector to get the direction infront of the player then use an offset, example:

local Offset = Vector3.new(3, 0, 3) --Mess around with these numbers until you get what you want exactly
local TargetPoint = (Character.PrimaryPart.Position + ((Character.PrimaryPart.CFrame.LookVector).Unit * 10)) + Offset
local Direction = (Character.PrimaryPart.Position - TargetPoint).Unit --Multiply this to increase range of direction
1 Like

Before I’ll test this script, how would I get the OriginPoint?

Edit: After having misunderstanding with your post and finally understanding, that works.