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
 

Moving bricks... with no gravity?

Previous Thread :: Next Thread 
Busterkiki01 is not online. Busterkiki01
Joined: 17 Jul 2012
Total Posts: 61
15 Nov 2015 12:24 AM
Yeah, I know, bad title, it's a little bit more complex than that.

So I was messing around with removing or at least nulling gravity and wanted to make a brick orbit another brick. I figured the easiest way to do this would be to just set the one brick's position to that of the others constantly, changing it slightly as it moves, instead of coding an advanced algorithm. However, this is impossible as constant changing of a position causes lag and then a crash. So, I figured that has to be a way to change the position smoothly, like GUI tweening or WalkToPosition in humanoids...

Any ideas?

Here's my current script:

-- set gravitational pull to 0
script.Parent.BodyForce.force = Vector3.new(0, 196.2, 0) * script.Parent:GetMass()


while true do
wait(1)
x = game.Workspace.null.Position.X
y = game.Workspace.null.Position.Y
z = game.Workspace.null.Position.Z
script.Parent.Position = Vector3.new(x+ 1 , y, z)
end


--note that 'null' is another brick in the workspace with a script removing gravity and a BodyForce inside of it
Report Abuse
Busterkiki01 is not online. Busterkiki01
Joined: 17 Jul 2012
Total Posts: 61
15 Nov 2015 05:18 PM
.-.
Report Abuse
XIPokezIX is not online. XIPokezIX
Joined: 24 Sep 2015
Total Posts: 381
15 Nov 2015 05:21 PM
Body position
Report Abuse
Busterkiki01 is not online. Busterkiki01
Joined: 17 Jul 2012
Total Posts: 61
15 Nov 2015 05:56 PM
Care to add some detail?
Report Abuse
Busterkiki01 is not online. Busterkiki01
Joined: 17 Jul 2012
Total Posts: 61
18 Nov 2015 10:42 PM
So now my script looks like this and the new part won't move...


-- set gravitational pull to 0
script.Parent.BodyForce.force = Vector3.new(0, 196.2, 0) * script.Parent:GetMass()


while true do
wait(0.5)
null = script.Parent:FindFirstChild("BodyPosition")

null = game.Workspace.nullbaby.BodyPosition
end
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