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 » Scripters
Home Search
 

Re: Part Spawning Problem

Previous Thread :: Next Thread 
Trioxide is not online. 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
distalDigitPhalanx is not online. distalDigitPhalanx
Joined: 25 Jan 2015
Total Posts: 1509
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 is not online. 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
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
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 is not online. 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
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
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
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
11 May 2015 09:41 AM
Why not use BodyMovers?
Report Abuse
CrowClaws is not online. 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
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
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
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
11 May 2015 09:44 AM
@epicbreaker That is what I am doing
Report Abuse
Roblok1 is not online. 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
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
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
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
11 May 2015 10:14 AM
@BFF, you ninja'd me >:U
Report Abuse
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
11 May 2015 10:17 AM
Hahaha I mean... sorry.
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
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 is not online. 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
Kapitanovas is not online. Kapitanovas
Joined: 09 Sep 2012
Total Posts: 4216
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 is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
11 May 2015 11:07 AM
Thank you guys for derailing the thread.
Report Abuse
Trioxide is not online. 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 is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
11 May 2015 11:47 AM
Sucks to be you, huh?
Report Abuse
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
11 May 2015 11:49 AM
@Trioxide If you don't want BodyMovers what do you want then?
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
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 is not online. 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
BFFstick00 is not online. BFFstick00
Joined: 25 Oct 2010
Total Posts: 800
11 May 2015 11:55 AM
Ooooh your using the part velocity.
Report Abuse
Trioxide is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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