kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
|
| 02 May 2014 07:24 AM |
Hi.
Is there a way to reset torso velocity? Like, if the character is in air, during falling, can I somehow reset his velocity so that he starts from 0,0,0 again (So that he would slow down to, like, 0 vertical speed and the gravity would be forced to reaccelerate him from start, while in air)
I tried player.Character.Torso.Velocity = Vector3.new(0,0,0) but that doesn't do anything. |
|
|
| Report Abuse |
|
|
kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
| |
|
|
| 02 May 2014 09:09 AM |
BodyForce.
~masterCameron101, advanced Lua programmer, certified graphics designer and geek~ |
|
|
| Report Abuse |
|
|
|
| 02 May 2014 09:16 AM |
| you need to make same force that is pushing player up |
|
|
| Report Abuse |
|
|
kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
|
| 02 May 2014 09:21 AM |
| If I add bodyforce, how long should I make it stay? Ideally I'd want to keep it for one game tick, so that torso's velocity had been zeroed. How do I go about that, though? |
|
|
| Report Abuse |
|
|
kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
| |
|
|
| 02 May 2014 11:18 AM |
I tried player.Character.Torso.Velocity = Vector3.new(0,0,0)
That should work for his Y Velocity, the middle number (up & down), do for what u want that should be fine.
But .Velocity's X & Z, for a Humanoid, cannot be set. You can use BodyVelocity for that. This function is used in Auto-Tackle to deliver a "Block" to another player....
function windforce(dir, victimTorso) for i=1,3 do if victimTorso.Parent:FindFirstChild("ForceField") then return end if not victimTorso:FindFirstChild("WindEffect") then local force = Instance.new("BodyVelocity") force.Name = "WindEffect" force.maxForce = Vector3.new(1e7, 1e7, 1e7) force.P = 125 force.velocity = (dir * 30) force.Parent = victimTorso game.Debris:AddItem(force, .25) end end end
|
|
|
| Report Abuse |
|
|
|
| 02 May 2014 11:29 AM |
um... this does work but....
for i=1,3 do -- Don't know why he throws 3 BVd into Torso. I don't think u have to do that... if victimTorso.Parent:FindFirstChild("ForceField") then return end if not victimTorso:FindFirstChild("WindEffect") then local force = Instance.new("BodyVelocity") force.Name = "WindEffect" force.maxForce = Vector3.new(1e7, 1e7, 1e7) force.P = 125 -- ... instead just monkey with these numbers... force.velocity = (dir * 30) force.Parent = victimTorso game.Debris:AddItem(force, .25) -- He tells the Force to kill itself afte a 1/4 of a second... end end
|
|
|
| Report Abuse |
|
|