generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How would I make something move away from a point

Previous Thread :: Next Thread 
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
23 Sep 2014 08:01 PM
Like instead of humanoid:MoveTo(POINT)

it would move in the exact opposite direction of that point.

I was thinking about somewith with :inverse() or something but I really have no clue.
Report Abuse
NotAshley is not online. NotAshley
Joined: 16 Jan 2014
Total Posts: 14257
23 Sep 2014 08:03 PM
This will probably require an extremely annoying amount of math.
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
23 Sep 2014 08:04 PM
hmm interesting


im going to try and see if I could do that
Report Abuse
monkey1589 is not online. monkey1589
Joined: 06 Feb 2010
Total Posts: 2334
23 Sep 2014 08:05 PM
I was going for inversing the walkspeed, but that wouldn't work!
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
23 Sep 2014 08:07 PM
maybe..


local newpos=human.Position+(human.Position-targ.Position)
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
23 Sep 2014 08:11 PM
I tried this to see if inverting the cords will invert the player going to that part

wait(10)
X = script.Parent.Position.X
Y = script.Parent.Position.Y
Z = script.Parent.Position.Z
for i,v in pairs(game.Players:GetChildren()) do
v.Character.Humanoid:MoveTo(Vector3.new(X-X-X,Y-Y-Y,Z-Z-Z)) -- minusing a number 3 times will neg it
end

but it failed
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
23 Sep 2014 08:16 PM
So far in tests mine works.


example:


(10,10)+((10,10)-(5,5))=(15,15)

is that the opposite?
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
23 Sep 2014 08:29 PM
5-5-5 = -5

7-7-7 = -7

thats what x-x-x is doing but it did not turn out good
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
23 Sep 2014 08:35 PM
torso = humanoid.Parent.Torso
mirror = torso - POINT
humanoid:MoveTo(POINT+mirror)
Report Abuse
TochiWasHere is not online. TochiWasHere
Joined: 13 Mar 2013
Total Posts: 160
23 Sep 2014 08:37 PM
I'm not sure "how far" the point needs to go away from its point but ill assume its the magnitude of the characters modelcf and the point

--------------------------------

function MoveFromPoint(chr,point)
chr.Humanoid:MoveTo(CFrame.new(chr:GetModelCFrame().p,point).lookVector*(-(chr:GetModelCFrame().p-point).magnitude*2))
end

MoveFromPoint(game.Workspace.Player1,Vector3.new(0,0,0))


-Was Here
Report Abuse
BJCarpenter is not online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
23 Sep 2014 08:37 PM
*
torso = humanoid.Parent.Torso
mirror = torso.Position - POINT
humanoid:MoveTo(POINT+mirror)
Report Abuse
LordMatthewII is not online. LordMatthewII
Joined: 20 Aug 2011
Total Posts: 10873
23 Sep 2014 08:42 PM
This works just fine, thankyou.

hunt:MoveTo(Vector3.new(gotopos.X*100,torso.Position.Y,gotopos.Z*100))
Report Abuse
blockoo is not online. blockoo
Joined: 08 Nov 2007
Total Posts: 17202
23 Sep 2014 08:58 PM
Here's my way:

Torso.Position - (goal - Torso.Position)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image