Dreamlike
|
  |
| Joined: 29 Feb 2012 |
| Total Posts: 16147 |
|
|
| 20 Jun 2015 07:58 PM |
| In other words, how do I move a player in a certain direction while keeping the other two coordinates the same? |
|
|
| Report Abuse |
|
|
|
| 20 Jun 2015 07:58 PM |
| (part).Position = Vector3.new(5,(part).Position.Y,(part).Position.Z) |
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 08:00 PM |
Simple, Character:MoveTo(Character.Torso.Position + Vector3.new(X, Y, Z)) Granted that can also put your character on top of any blocks they end up colliding with. To avoid that, you can use this, Character.Torso.CFrame = Character.Torso.CFrame + Vector3.new(X, Y, Z) That will also keep their current rotation. |
|
|
| Report Abuse |
|
|
| |
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 08:05 PM |
Note that changing a part's .Position will instantly break any joints it had with other parts.
If you want to move the character relative to the direction they're facing, use:
Character.Torso.CFrame = Character.Torso.CFrame + (Character.Torso.CFrame * Vector3.new(-Left/Right, -Down/Up, -Forward/Backward) - Character.Torso.Position).Unit |
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 08:05 PM |
| :Move() is used to make the player's character walk in a specific direction. Is that what you're asking for? |
|
|
| Report Abuse |
|
|
Dreamlike
|
  |
| Joined: 29 Feb 2012 |
| Total Posts: 16147 |
|
| |
|
Dreamlike
|
  |
| Joined: 29 Feb 2012 |
| Total Posts: 16147 |
|
|
| 20 Jun 2015 08:41 PM |
Somethings wrong, Sometimes I appear to be a significant amount away from the value, only on the X value I am changing though. Here the part of the script. workspace.Player.Torso.CFrame = workspace.Player.Torso.CFrame + Vector3.new(-19.4, workspace.Player.Torso.Position.Y, workspace.Player.Torso.Position.Z)
Could a block be interfering? |
|
|
| Report Abuse |
|
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 08:45 PM |
Nonono, change your Vector3 to (-19.4, 0, 0). Remember, that's the value you're adding. If you add your original position, you're just doubling your distance from the center of your game. |
|
|
| Report Abuse |
|
|
Dreamlike
|
  |
| Joined: 29 Feb 2012 |
| Total Posts: 16147 |
|
| |
|
Jammer622
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 1739 |
|
|
| 20 Jun 2015 08:52 PM |
| Any time. Message me personally if you want my help again, otherwise I'm sure you can always get help from the others on this forum. |
|
|
| Report Abuse |
|
|