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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|