|
| 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 |
|
|
| |
|
XIPokezIX
|
  |
| Joined: 24 Sep 2015 |
| Total Posts: 381 |
|
| |
|
| |
|
|
| 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 |
|
|