Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can you fling someone the opposite way?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.