|
| 31 Dec 2013 12:21 PM |
I *kinda* understand LookVector, so how would I make it so that when my player presses a certain key ("t") that it "flies" a few studs in front of where it is looking?
Basically all I want is to put the lookVector in the "position" property of the BodyPosition (or however it's done), since that property doesn't support CFrame. How is that possible, though? |
|
|
| Report Abuse |
|
|
| |
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 31 Dec 2013 12:33 PM |
bp = script.parent.BodyPosition dist = 2
--when t is pressed : bp.position = script.Parent.Position + script.Parent.CFrame.lookVector * 2 |
|
|
| Report Abuse |
|
|
Absurdism
|
  |
| Joined: 18 Jul 2013 |
| Total Posts: 2568 |
|
|
| 31 Dec 2013 12:35 PM |
lookVector is a unit vector, thus, it will hardly have any effect on the magnitude of a product. What we have to do is specify an orthogonal point using a vector, redirect it by lookVector so it points in the right direction, and multiply that vector by a scalar to get it the right length.
Instance.new('BodyPosition', character.Torso).position = character.Torso.CFrame.lookVector * 4
Just mess around with it in the command line. I recommend that wholeheartedly. |
|
|
| Report Abuse |
|
|
| |
|