Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How can you fling someone the opposite way?

Asked by 10 years ago

Hi, Is just that I need to know how would you fling someone to the opposite direction?

I've tried (Workspace.MyTorso.Position, Workspace.HisTorso.Position).lookVector to get the direction btw me and the other player but it's not working, any idea?

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

You're just missing

CFrame.new

at the beginning of that.

Still, there's a simpler way to do it:

direction = (to - from).unit;
-- where to and from are 
-- Vector3's and direction
-- is a unit Vector3 (of length 1)
-- which points in the direction from 'from'
-- to 'to'.

-- Equivalent:
direction = CFrame.new(from,to).lookVector;
-- ...just not as clear or elegant
Ad

Answer this question