Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 11 May 2015 08:48 AM |
Hey.
Lets say I create a new part:
local part = Instance.new("Part", Workspace) part.Position = Vector3.new(0, 20, 0)
After this, the part starts to fall immediately. But here lies the problem:
local part = Instance.new("Part", Workspace) part.Position = Vector3.new(0, 20, 0) part.Velocity = Vector3.new(0, 0, 250)
The part freezes in midair for a jiffy before taking off because I set the Velocity.
Any way to fix this?
|
|
|
| Report Abuse |
|
|
|
| 11 May 2015 08:52 AM |
| Anchor it if you don't want it to fall. Use bodyVelocity or bodyForce or something if you want it to keep flying. Do you mean that it freezes when you start the game? It might do this because the physics aren't loaded yet(I have no idea). |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 11 May 2015 08:55 AM |
I don't want to anchor it. I want to launch it.
The thing about BodyMovers derails the thread.
The part freezes when I *spawn* the part *and* set its velocity right after. |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 09:35 AM |
| well, you need to add the velocity before you add its parent. You're putting it into workspace, then naming it, then adding velocity. |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 11 May 2015 09:40 AM |
| Try parenting it to the workspace after you set its properties. |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 09:40 AM |
Try: local part = Instance.new("Part", game.Workspace) part.Position = Vector3.new(0, 20, 0) local force = Instance.new("BodyVelocity", part) force.velocity = Vector3.new(0, 5, 0) |
|
|
| Report Abuse |
|
|
| |
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 11 May 2015 09:41 AM |
local part = Instance.new("Part") part.Position = Vector3.new(0, 20, 0) part.Velocity = Vector3.new(0, 0, 250) -- if you want it to floot you are going to have to do some math with part:GetMass() part.Parent = workspace |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 09:43 AM |
Or following roblok1's request: local force = Instance.new("BodyVelocity", Instance.new("Part"), game.Workspace) force.velocity = Vector3.new(0, 5, 0) force.Parent.Position = Vector3.new(0, 20, 0) |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 09:44 AM |
| @epicbreaker That is what I am doing |
|
|
| Report Abuse |
|
|
Roblok1
|
  |
| Joined: 27 Jul 2011 |
| Total Posts: 2019 |
|
|
| 11 May 2015 09:46 AM |
^
that's not what I said. I just said parent the part to the workspace after setting its properties. Maybe even before applying the force. |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 09:50 AM |
Fixed request: local part = Instance.new("Part") part.Position = Vector3.new(0, 20, 0) local force = Instance.new("BodyVelocity", part) force.velocity = Vector3.new(0, 5, 0) part.Parent = game.Workspace |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 11 May 2015 10:48 AM |
Gravity is a factor in Velocity, so you need to actually upon that.
I think this would work?
function applyForce(part,velocity) local equalizingForce = 196.2 -- Amount of force required to levitate a part. local mass = part:GetMass() return velocity * (mass * equalizingForce) end |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 11 May 2015 10:52 AM |
| Is it not just the initial physics lag when you hit run in the studio? |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 11:00 AM |
as most people say, if it ACTUALLY FREEZES for like a second or so, then set the .Velocity 1st place...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 11 May 2015 11:07 AM |
| Thank you guys for derailing the thread. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 11 May 2015 11:46 AM |
| I've read every reply and this thread is yet to offer an answer. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
| |
|
|
| 11 May 2015 11:49 AM |
| @Trioxide If you don't want BodyMovers what do you want then? |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 11:52 AM |
Try swapping Position and Velocity.
local part = Instance.new("Part", Workspace) part.Velocity = Vector3.new(0, 0, 250) part.Position = Vector3.new(0, 20, 0)
|
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 11 May 2015 11:54 AM |
"If you don't want BodyMovers what do you want then?"
Read the original post. |
|
|
| Report Abuse |
|
|
|
| 11 May 2015 11:55 AM |
| Ooooh your using the part velocity. |
|
|
| Report Abuse |
|
|
Trioxide
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 32902 |
|
|
| 11 May 2015 11:56 AM |
"Try swapping Position and Velocity.
local part = Instance.new("Part", Workspace) part.Velocity = Vector3.new(0, 0, 250) part.Position = Vector3.new(0, 20, 0)"
The problem persist. |
|
|
| Report Abuse |
|
|