jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 04 Feb 2014 03:40 PM |
Assuming this was a full script(don't have time to write it out on phone) would this work?
function MovePart(B, Pos1, Pos2) CFrame = CFrame.new(Pos1, Pos2) getVector = CFrame.lookVector Force = Instance.new("BodyForce") Force.Parent = B Force.force = Vector3 . new(getVector) end MovePart(Workspace.Part1, Workspace.Part1.Position, Workspace.Part2.Position) |
|
|
| Report Abuse |
|
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 04 Feb 2014 03:42 PM |
| Excluding the obvious syntax errors(thanks phone) would this work? |
|
|
| Report Abuse |
|
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 04 Feb 2014 10:02 PM |
| Guess ill have to test it when i get the chance :p |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 04 Feb 2014 10:05 PM |
| most likely. i gotta pee so tl dr sorry |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 04 Feb 2014 11:35 PM |
Yes but inefficient. Why not just
function MovePart(B, Pos1, Pos2)
Force = Instance.new("BodyForce") Force.Parent = B Force.force = Vector3.new((Pos2-Pos1).unit) end MovePart(Workspace.Part1, Workspace.Part1.Position, Workspace.Part2.Position) |
|
|
| Report Abuse |
|
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 05 Feb 2014 12:20 AM |
@wazap
"Assuming this was a full script(don't have time to write it out on phone)"
it was just something real quick i made on my phone, I know nothing about Body Force/Gyro/Etc :(
Also, it doesn't have enough force, it returns as decimals less than 0. How am I to increase the force, so Part1 will move towards Part2? |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 05 Feb 2014 12:55 AM |
the inefficiency wasnt the BodyForce. The inefficiency was that you made a CFrame then used lookVector property... which was like an unnecessary part.
As for not enough force Force.force = Vector3.new(getVector)*20000--Change this to a lower number for less power. Should solve it |
|
|
| Report Abuse |
|
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
|
| 05 Feb 2014 06:51 PM |
"decimals less than 0"
They round up to be 0, and anything * 0 = 0 |
|
|
| Report Abuse |
|
|
jd678
|
  |
| Joined: 18 Apr 2008 |
| Total Posts: 11529 |
|
| |
|