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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How would I push a player according to their position?

Previous Thread :: Next Thread 
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
07 Jul 2014 10:58 PM
Like explosions, they push any player away according to the explosion position.
Basically, how would change a players velocity to push it away from something.
Report Abuse
thespirjet is not online. thespirjet
Joined: 19 Oct 2011
Total Posts: 160
07 Jul 2014 11:03 PM
I would use pythagoreans theorum twice, once for the horizontal axis, and once to incorporate that into the y distance, resulting in the diagonal distance. Then just use that and multiply/divide that distance to the velocity vector, resulting in a fluid velocity-distance thingamajig. I would also use an if statement to disregard people really far away from the pushing force. Don't feel like making this script right now...
Report Abuse
Brickman2010 is not online. Brickman2010
Joined: 20 Nov 2009
Total Posts: 5547
07 Jul 2014 11:05 PM
cant you just find the direction using (position1-position2).unit

Then add the velocity*the magnitude/the radius of the explosion?
Report Abuse
thespirjet is not online. thespirjet
Joined: 19 Oct 2011
Total Posts: 160
07 Jul 2014 11:09 PM
I find the Pythagorean theorem to be easier then subtracting the values of the positions, but that would work.

I avoided doing your second part, just in case he didn't want to use an explosion. If you do use an explosion though, then go for that
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
07 Jul 2014 11:24 PM
So something like this:

a^2 = b^2 + c^ -- What will the variables be? You want me to implement that with the x axis.

torso.Velocity = Vector3.new(a^2=b^2+c^, 0, 0) -- tf..

Not sure if talent or sarcasm.
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